Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

Differences between PHP4 and PHP5

  • Please log in to reply
2 replies to this topic

#1 falco85


    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 105 posts

Posted 26 April 2006 - 09:27 AM

I am an old PHP4 programmer; at the moment I don't see the point to switch to PHP5 since it would require some learning curve, but what are the real differences between the two versions? Is there a real improvement? As far as I know the only difference is for the implementation of an object oriented programming structure, but I don't know of further innovations. Any help is greatly appreciated!
  • 0

#2 RobSoftware


    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 141 posts

Posted 26 April 2006 - 01:06 PM

The "true" OO structure is one of the big points of PHP5. There are also a lot more built-in functions and several improvements. Other than that, I didn't see a whole lot of difference either.
  • 0

#3 Crane


    CC Addict

  • Just Joined
  • PipPipPipPipPip
  • 388 posts

Posted 28 April 2006 - 12:58 PM

From PHP.net's archive:

* The Zend Engine II with a new object model and dozens of new features.
* XML support has been completely redone in PHP 5, all extensions are now focused around the excellent libxml2 library (http://www.xmlsoft.org/).
* A new MySQL extension named MySQLi for developers using MySQL 4.1 and later. This new extension includes an object-oriented interface in addition to a traditional interface; as well as support for many of MySQL's new features, such as prepared statements.
* SQLite has been bundled with PHP. For more information on SQLite (http://sqlite.org/).
* A brand new built-in SOAP extension for interoperability with Web Services.
* A new SimpleXML extension for easily accessing and manipulating XML as PHP objects. It can also interface with the DOM extension and vice-versa.
* Streams have been greatly improved, including the ability to access low-level socket operations on streams.

Overall, though, most things have remained the same. Scripts that are created to run with PHP4 should work fine with PHP5 if you are considering upgrading. However, there are some compatibility issues:

List of Backward Incompatible Changes Between PHP4 and PHP5:

For more information, check out the PHP4 / PHP5 migration FAQ:

PHP5 ChangeLog:
  • 0

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download