PHP 6 and What to Expect 101
An anonymous reader writes "Jero has a few interesting thoughts on what PHP 6 is driving towards and provides a nice overview of what has been keeping the PHP team busy lately. For more specifics, PHP.net also has the developers meeting minutes from last November available with a great recap of all the major issues on their platter."
Namespace (Score:4, Insightful)
Its not going to attract a bigger audience (Score:2, Insightful)
They should finish working on PEAR and getting it properly documented along with getting most of the respoitory packages out of "alpha" release. Then we wont have this stigma about
Its good to see that they want to "fine tune" php and they are discussing the important programming syntax elements of the langauge, but like everyone else is saying why move to v5 in the first place? Well for those
Otherwise I presonally believe we'll start seeing Ruby hit the scene a bit more and
GOTO? (Score:2, Insightful)
PHP needs serious redesigns (Score:5, Insightful)
PHP's design is fucked up. Some functions have underscores, others don't; some have numbers, others don't: strtolower, isset, stripslashes compared with hex2bin, is_null and strip_tags to name a few. Why? Who knows? But too many applications rely on these inconsistencies, and making them consistent would break everything.
It has no namespaces. Luckily, they are to be added in PHP 6 (and about time too!), so we can do $db::connect() rather than mysql_connect($db). So can we get rid of all the mysql_* and other pseudo-namespace functions please? They are annoying and will be wholly unnecessary.
Security problems. Register_globals and magic_quotes are still built into PHP when they should be built out and as far away from it as possible (and they are!). There are going to be people who will wonder why this upgrade breaks those things, and people should know that a new language does things differently. (Likewise: Perl 6's given/when block isn't called switch/case because it behaves differently).
Now that I've typed all that, much of my reasoning is that people rely on PHP's being bad. People should never rely on poor language design, or bugs, or bloat, of which PHP has loads. The language should work, you shouldn't need to work around the language - and if you do, you're going to have a lot of trouble rewriting your code.
There might be little incentive to switch away from older versions of PHP for some people, but a few refinements of the language won't change that. "Better than PHP" would actually be true. "Made from the PHP team" would be a major selling point too.
I know that it's a bit risky saying this here (there seem to be a lot of people who like PHP for some reason), but a serious redesign is in order, and it's more than just a simple bumping up of the version number can fix.
Re:Do most users even need PHP 6? (Score:4, Insightful)
Try some other languages (Ruby, Python, CLisp/Scheme/Haskell/OCaml if you manage to get past the syntax), you'll see that PHP is lacking in many areas.
Closures (even read-only, as in Python), functions as first-class objects, namespaces, modules, consistency across the standard library, properties, metaobjects, strong typing (not static, strong), infinite-length integers (these dummies want to add a 64bits integer in PHP6... whoa, so kewl eh), good iterators (not Java's, either Ruby style or Python style iteration), partial application (curryfication), pattern matching, ...
Re:Do most users even need PHP 6? (Score:4, Insightful)
In my experience (working in large PHP driven shops) the people writing PHP didn't necessarily have a comp sci background. They don't care (and most don't even know) wahat a first-class object is, why they would even want namespaces, strong typing or 64 integers. In fact, adding them to the language makes it in accessible to them, so they'll just stick with php 4, which "works for me."
I mean, in a fundamental sort of way, yes PHP is broken, but in a useable sort of scripting language way, PHP 4 isn't broken. And if it ain't broke, then don't try to fix it.