Friday, March 13, 2015

About PHP6

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...)

A blogger

I am passionate blogger cum B.Tech. Computer engineering graduate. I love writing blog post. I spend my free time in writing blog post that will useful to everyone (including me). I have had some success making money blogging and want to help others do the same. I just figured that by creating a great and free resource a lot of links would follow – and they have. Some people ask me how they can repay me – which is not necessary - but for those wanting to show their appreciation, I just say linking to the article from their blog is the best compensation I could receive. Thanks for reading!

0 comments:

Post a Comment

Thanks for commenting. I will Reply you soon

 

Copyright @ 2013 PHP WORDPRESS MAGENTO .

Designed by Kcon Technosoft