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

Ilia Alshanetsky's Blog: Scalar Type Hints are Here!

DevShed: Enforcing Object Types in PHP - Using the Type Hinting Feature in PHP 5

Anthony Ferrara's Blog: Parameter Type Casting in PHP

WebCheatSheet.com: Secure File Upload with PHP

Sebastian Bergmann's Blog: Scalar Type Hints in PHP 5.3.99


Community Events





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


version interview language voicesoftheelephpant symfony release composer introduction opinion library install laravel security application framework update package community series podcast

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