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

Christian Weiske's Blog: A MIME type for .php files

WebCheatSheet.com: Secure File Upload with PHP

Jani Hartikainen's Blog: Static/Dynamic typing sweet spot

Soledad Penades' Blog: Signs your PHP needs refactoring

Anthony Ferrara's Blog: PHP's Source Code For PHP Developers - Part 3 - Variables


Community Events





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


interview package api symfony community introduction release list bugfix framework deployment voicesoftheelephpant library opinion install language laravel series tips podcast

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