PHP 5.3alpha

The next minor version of PHP5(5.3; currently in the alpha stage) will include support for NOWDOC, Lambda functions & Closures, and the much anticipated ternary shortcut(?:). NOWDOCs are basically HEREDOCs, but without interpolation. It’s like using single-quotes versus double-quotes in your strings. Lambda functions allow you to define a single-use function so that it doesn’t have to be defined in the global scope of the script throughout execution. You can exectute things like loops or callbacks without having to define the function ahead of time, and you can return the value of your loops or callbacks to a variable directly. The Ternary shortcut is to allow you to perform a quick if() & return the result, which is what the Ternary operator(s) does already, but you don’t have to specify an “else” value. Most(all?) of these features were discussed for inclusion in PHP6, but it looks like they’ve been backported, which is good. 🙂

Also included will be “limited GOTO” which, as I understand it, will entail using the break language construct to jump to a certain position in the script. The information that I’ve seen is minimal, but this feature could be useful to a lot of people as well.