Introduction
This is a set of slides
from Andrei Zmievski, one of the core PHP developers. It explains what
the plan for PHP6 was (Unicode everywhere), and why it's stalled.
One of the big problems has to do with what happens when you impose Unicode rules on programs that aren't fully equipped to deal with Unicode. For example, read this Unicode rant by famed Perl developer Tom Christiansen.
While the rant is about Perl's Unicode support, the general theme and
lessons learned are completely applicable to the PHP6 Unicode effort.
In short, it's going to be the world's biggest backwards compatibility break ever, and will introduce subtle bugs in every script. In fact, it was going to be so bad that they had to introduce a "turn Unicode semantics off" mode just to make sure that old scripts would continue to work.
I personally doubt that we'll ever see the current branch in the PHP
source repository called "PHP6" in production. It's both too
wide-ranging and, as noted in Andrei's slides, doesn't have a lot of
developer support.
Meanwhile, PHP 5.4 is moving forward They're working on the formal release process. Here's a rough list of current TODO items, including a few "last minute" features to discuss, like a built-in simple web server for dev testing, an optional, more terse array syntax (which was, incidentally, already in discussion again before all the recent hubbub about it being voted down months ago), and an option for a JSON-inspired syntax, with implicit
stdClass
creation. That last one has been particularly controversial on php-internals.
Features already implemented for 5.4 include function call array dereferencing (the ability to say
foo()['bar']
and have it work), and most interestingly, traits, a way to extend classes via composition rather than inheritance. Recently there was also a change to always permit the <?=
syntax, even when short tags are off.
It's also worth noting that type "hinting"
was briefly implemented, but has since been reverted because nobody
could agree on what happens when a "hint" assertion fails and all of the
available options sucked in bad ways. Various blog posts elsewhere
documented the initial implementation.
However, 5.4 is still quite a while from being in production.
Development isn't finished, and we're surely a few months from a beta,
no less a usable beta. (I'm irritated at this, as my current project
could really use traits...)
0 comments:
Post a Comment
Thanks for commenting. I will Reply you soon