PHP version difference.

PHP version difference is something that likely to be neglected for most “script writers”.

Especially when upgrading system, paying attention to version difference is extremely important when you looking after the code.
Here are some brief points that in my opinion should be remembered all the time.

  1. From PHP5.2 to PHP5.3
    (Most php version starts from PHP5.3 now. If not, urgently upgrade!!)

    • Since PHP5.3 has namespaces, this is critical important for modern PHP development. Needed for most of modern frameworks
    • PHP5.3 support native closures
    • goto is enabled
    • If version PHP >= 5.3.7, password_compat lib can be used for encrypting passwords by BCRYPT implementation. Ref Here
  2. From PHP5.3 to PHP5.4
    (This is the major upgrade, several key points needs to be remembered)

    • MAGIC QUOTES is removed. The evil is gone.
    • Safe Mode is not supported, which used to check the ownership of script matches the owner of the file to be operated on.
    • Closure support $this
    • Support build-in Test only server such as $ php -S localhost:8000 -t foo/
  3. From PHP5.4 to PHP5.5
    • Windows XP support dropped
    • finally block added
    • New password Hahsing API as mentioned earlier. (password_hash())
  4. From PHP5.5 to PHP5.6
    • Exponentiation Operator ** is added
    • json_decode will see non-lowercased variants of true, false and null as invalid.