New PHP 5.3 Release June

Q2 is basically April, May, and June and the 5.3 timeline says Q2 stable release. I’ve been reading mostly good things about the experimental release and considering all the new features being added every php developer should be stoked. I’m not just talking about the new closures/lambda functions which are gonna make my life a lot more fun. Here’s a list of all the fun stuff that I’ll be playing with next month:

  • Namespace support. It’s about time.
  • Late static binding. Somewhere between static and dynamic binding.
  • Jump label (limited goto)
  • Native closures. Simple javascript-like lambda functions. None of that create_function stuff anymore.
  • PHP archives (phar). Not sure why?
  • Garbage collection for circular references.
  • Ternary shortcut. Still haven’t seen an example of what this is?
  • Internationalization extension.

I’ve always been told that goto’s are bad programming practice but sometimes they can be very, very useful. Hopefully they get all the bugs out in the experimental versions and I can start using it at work  shortly after release.


4 Responses to “New PHP 5.3 Release June”

  • david Says:

    Actually the ternary shortcut is not that spectacular.

    $x = (true) ? : false ;

    But it only outputs true so it can be only used for a boolean check

    echo (isset($test)) ? : ” ;
    echo ($test == 10) ? : ” ;

    Both cases will output 1.

  • Daniel Egeberg Says:

    You can do like this for “ternary shortcut” in earlier versions of PHP:

    !isset($test) || $test = ”;

    The right operand of logical OR will only be evaluated if the left operand evaluates to false. If the left operand evaluates to false it isn’t worth evaluating the right operand because we already know that this binary operation should return true.

    Of course the syntax might throw some people off, so it’s probably better to just do

    if (!isset($test)) {
    $test = ”;

    Code also needs to be readable after all.

  • Sarwar Faruque Says:

    “PHP archives (phar). Not sure why?”

    PHAR is almost the equivalent of having JAR files in Java. In terms of file distribution, the PHAR file and a config file are the only 2 files one would have to deploy to a client.

    Personally I’d like PHAR’s more if they could add a level of code encryption and not just act like a wrapper.

  • epsi Says:

    PHP 5.3 platform affected some CMS/ Framework.

    Here is Official Compatibility Support (14 September 2009).
    – Silverstripe 2.3.3, released already
    – Joomla 1.5.15, almost ready, now testing
    – CakePHP 1.3
    – bbPress 1.0.3
    – XOOPS 2.4
    – CMSMS 2.0 along with Silk framework
    – ? Drupal 5.20 and 6.14 || Drupal 7.0
    – ? WordPress 3.0 (2010) || core already compatible
    – ? ImpressCMS 1.3
    – ? ModXCMS (unknown)

    Consider application compatibility before upgrade to XAMPP 1.7.2. WampServer 2.0i could use PHP Version lower than 5.3.