What's New In PHP 5.3

PHP 5.3 is the current stable branch of PHP which is considered to be the fastest and most secure PHP version so far. Since PHP 6.0 has been delayed it seems that PHP 5.3 concepts will be the de facto PHP standards for a long time. In this article we will cover all that is important in the new version:
  1. Deprecated functions in PHP 5.3 - ´╗┐Register Globals, Magic Quotes and Safe Mode. If used these will caused E_Deprecated error (also new in PHP 5.3). These changes are important (especially for website security) even though it's doubtful anyone still uses them. Also, you will find out it's not longer possible to assign the return value of new by reference in OO programming.
  2. New Features in PHP 5.3:
  • Namespaces - used to encapsulate items and divide PHP code. PHP 5.3 namespaces aim to solve the problems of name collisions and introduce a way for name aliasing.
  • Goto operator - those familiar with Perl will make the association where it has come from :) In short it is used to skip to another section of the program.
  • Nowdoc - similar to heredoc but no parsing is done inside the nowdoc block and there is no need for escaping characters.
  • Shorthand for the ternary operator. Now you can omit the second expression.
For all the changes in PHP 5.3 please check the official migration list. In conclusion we can assume the new changes are positive and will help programmers write easier better and more secure PHP applications witg PHP 5.3.
blog comments powered by Disqus