Jump to content

Differences between PHP4 and PHP5

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
falco85

falco85

    Programmer

  • Members
  • PipPipPipPip
  • 105 posts
Hi,
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!

#2
RobSoftware

RobSoftware

    Programmer

  • Members
  • PipPipPipPip
  • 143 posts
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.

#3
Crane

Crane

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 398 posts
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:
http://us3.php.net/m...ncompatible.php

For more information, check out the PHP4 / PHP5 migration FAQ:
http://us3.php.net/m....migration5.php

PHP5 ChangeLog:
http://www.php.net/ChangeLog-5.php