http://blog.joshuaeichorn.com/slides/CoolThingsInPHP5/
A little History of PHP5
* July 13th 2004, PHP 5.0 released
* Nov 2006, PHP 5.2 released
* Go-php5.org
* December 31 2007, PHP4 EOL
* Upgrade Time
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
*
o public/private/protected
o Unified constructor name __construct()
o Destructor __destructor()
o Interfaces
o instanceof operator
o final methods/classes
o Explicit object cloning
o Class constants
o Static members/methods
o abstract classes/methods
o Class type hints
o dereferencing support $obj->method()->method()
o __autoload()
Better XML
* Real DOM Support
* No more leaks etc
* Based on libxml2 (fast)
* SimpleXML
Better Webservices
* JSON extension for quick serializing to from javascript
* SOAP extension that actually works
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
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
Faster
* PHP 5.2 added lots of speed improvements
* Faster require_once
* Better memory management
* Lots of other stuff
So Upgrade
* PHP 4 support is being dropped by everyone
* PHP 5 offers better faster easier to write code
[
本帖最后由 Haohappy 于 2007-7-26 15:42 编辑 ]