Sunday 19 July 2009

PHP6 still under development

PHP6 is the latest, yet unreleased version of PHP. It is still under development and won’t be released for some time yet. Nonetheless, it is still important that we consider the changes we know about at the moment, and write scripts which are compatible.

If you want to make use of PHP6 when it comes, you’re going to have to write your new scripts so they are compatible, and possibly change some of your existing scripts. To start making your scripts PHP6 compatible, I’ve compiled a list of tips to follow when scripting:
  1. FILE_BINARY and FILE_TEXT constants available for use with filesystem functions.
  2. register_globals will be gone.
  3. magic_quotes will also disappear.
  4. $HTTP_*_VARS has been removed, in favour for $_GET, $_POST, etc.
  5. ereg() no longer available in core PHP6.
  6. Initiating objects with the reference operator (& new Object()) will generate E_STRICT error.
  7. E_STRICT error messages are included in E_ALL errors.
  8. {} for string offsets no longer available.
  9. [] un-deprecated for accessing characters in a string.
  10. ASP-style tags can no longer be used.
  11. Better Unicode Support.
  12. var will be an alias of public, and raises E_STRICT warning.
  13. Support for 64 bit integers.
  14. With ternary operator, the “true” expression is no longer required – this can be done: $a = $s ?: ‘b’; (Not clear yet exactly how this will work).
  15. zend.ze1_compatibility_mode removed.
  16. safe_mode is being removed.
  17. Freetype1 and GD1 support removed.
  18. dl() is only enabled when a SAPI layers registers it explicitly.
  19. Support for dynamic break levels removed.
  20. XMLReader and XMLWriter will be in the core distribution.
  21. mime_magic removed from the core.
  22. Fileinfo moved to the core.
  23. ext/soap on by default.
  24. foreach supports multi-dimensional arrays: foreach($a as $b => list($c, $d))
  25. microtime() will return as float by default.
  26. opcode cache included in core distribution, but turned off by default.
  27. flags parameter available for file_get_contents().
  28. before_needle parameter added to strstr() – allows strstr() to return part of haystack before occurence of the needle.
  29. namespace, import, and goto become reserved words.

No comments:

Post a Comment