News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Johannes Schluter's Blog:
More on scalar type hints in PHP trunk
November 23, 2010 @ 09:13:24

Johannes Schluter has posted a bit more information about the scalar type hinting that's been included in the main development line of the PHP language (trunk).

Some time ago I wrote an article about the implementation of type hints for non-object types for PHP. Meanwhile many things happened and that implementation was replaced by a different one. Readers of my previous post might know that I have doubts about type hints in PHP.

He shows some of the example syntax for the hinting and points out how, in one case, there's no error thrown when the type hint is a native one but an error is thrown on a custom type hint.

So why is there a syntax added which is ignored? [...] Well, I let it to you to decide whether it make sense to have two syntaxes which look the same but do very different things (being ignored vs. throwing a terminating error) and whether it makes sense to push a system where the core language behaves differently depending on the system. [...] I seriously hoped PHP was out of the era of introducing new inconsistencies.
0 comments voice your opinion now!
scalar type hints trunk inconsistent


blog comments powered by Disqus

Similar Posts

Johannes Schluter's Blog: Features in PHP trunk: Array dereferencing

WebTutor.pl: Strong data typing in PHP, part II: autoboxing and indestructable objects

Webgeekly.com: 20 Tips you need to learn to become a better PHP Programmer

Johannes Schluter's Blog: Upload Progress in PHP trunk

SitePoint: Blog Software Smackdown - The Big 3 Reviewed


Community Events





Don't see your event here?
Let us know!


code configure community language unittest bugfix api release application introduction symfony install wordpress interview podcast library developer list series laravel

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework