Tuesday, April 28, 2015

PHP: My favourite new features in PHP 5.6 / 5.5 / 5.4 / 5.3

PHP 5.6 Features

From PHP 5.5 to 5.6
----------------------------------------
http://php.net/manual/en/migration56.new-features.php
1. Constant expressions
   It is also now possible to define a constant array using the const keyword:
2. Variadic functions via ...
3. Argument unpacking via ...
4. Exponentiation via **
5. use function and use const
6. phpdbg
7. Default character encoding
8. php://input is reusable
9. Large file uploads
10. GMP supports operator overloading
11. hash_equals() for timing attack safe string comparison
12. __debugInfo() magic method has been added
13. gost-crypto hash algorithm
14. SSL/TLS improvements
15. pgsql async support

PHP 5.5 Features

From PHP 5.4 to 5.5
----------------------------------------
http://php.net/manual/en/migration55.new-features.php

http://www.techrepublic.com/blog/software-engineer/10-improvements-in-php-550-for-web-developers/
1. Generators added
2. finally keyword added
3. New password hashing API
4. foreach now supports list()
5. empty() supports arbitrary expressions
6. array and string literal dereferencing
7. Class name resolution via ::class
8. OPcache extension added
9. Apache 2.4 handler supported on Windows
10. Improvements to GD