Electricmonk

Ferry Boender

Programmer, DevOpper, Open Source enthusiast.

Blog

What’ll PHP6 bring us?

Thursday, February 23rd, 2006

CorePHP took the PHP 6 Developer Meeting notes minutes, which covers the discussion on the upcoming changes in PHP6, and made it into an nice summary article. Interesting stuff.

Looks like they’ll be breaking a lot of stuff such as removing the dreaded ‘Register Globals’ option, Safe mode and Magic Quotes. Good.

This piece of the minutes intrigued me:

Issue: PHP only supports type hinted arguments and not for return values or properties.
I recently saw that PHP supports type hinted arguments, but it only supports objects and arrays, not strings, integers, etc. I understand that this may seem useless to support anyway since PHP is a loosly typed language and integers will just get converted to strings and the other way around. But from my experience it’s still nice to do checking on parameter types; it catches a lot of programmer errors. Too bad strings and integers aren’t going to be supported as type hinted arguments.

The other thing I’m disappointed about is that there doesn’t seem to be any steering towards objectifying the primitive types such as string, integer and float. I like $foo = "bar:bas"; $foo->explode(':'); better than $foo = "bar:bas"; explode($foo, ':');. And if you’ll look closely at the previous example, you’ll know exactelly why. (hint: it has to do with argument order).

Oh well, I’ll just wait for PHP7 I guess ;-)

The text of all posts on this blog, unless specificly mentioned otherwise, are licensed under this license.