A little History
- July 13th 2004, PHP 5.0 released
- Nov 2006, PHP 5.2 released
- Go-php5.org
- December 31 2007, PHP4 EOL
- Upgrade Time
More History at:
http://en.wikipedia.org/wiki/Php
http://us2.php.net/history
http://museum.php.net/
I don't care about support
Lots of reasons to upgrade
- Better OO
- Better XML
- Better Webservices
- Better Database libraries
- Userland code that acts like core constructs
- Faster
Better OO
- Standard Reason for PHP 5
-
- public/private/protected
- Unified constructor name __construct()
- Destructor __destructor()
- Interfaces
- instanceof operator
- final methods/classes
- Explicit object cloning
- Class constants
- Static members/methods
- abstract classes/methods
- Class type hints
- dereferencing support $obj->method()->method()
- __autoload()
http://devzone.zend.com/node/view/id/1714#Heading3
Better XML
- Real DOM Support
- No more leaks etc
- Based on libxml2 (fast)
- SimpleXML
http://devzone.zend.com/node/view/id/688
http://www.onlamp.com/pub/a/php/2004/01/15/simplexml.html
Better Webservices
- JSON extension for quick serializing to from javascript
- SOAP extension that actually works
http://devzone.zend.com/node/view/id/689
Better Database Libraries
- Sqlite built in (you always have a db)
- Mysqli extension supports all the mysql 4.1+ features
- PDO provides native abstraction of databases covers all the majors
http://devzone.zend.com/node/view/id/760
http://devzone.zend.com/node/view/id/686
http://sitepoint.com/blog-post-view.php?id=282428
Userland code that acts like core constructs
- A class can be used in a foreach (iterator)
- A class can be accessed like an array
- You can add virtual methods __call
- You can add virtual properties __get/__set
http://www.sitepoint.com/article/php5-standard-library
http://www.onlamp.com/pub/a/php/2005/06/16/overloading.html
Faster
- PHP 5.2 added lots of speed improvements
- Faster require_once
- Better memory management
- Lots of other stuff
http://ilia.ws/files/phpworks_php52.pdf
So Upgrade
- PHP 4 support is being dropped by everyone
- PHP 5 offers better faster easier to write code