Difference between php-4 and php-5

This is a very common interview question. If you are going for the interview then you have to know the difference between these. Below is the basic difference of PHP-4 and PHP-5 -

1- PHP-4 is a procedural language where as PHP-5 is a object oriented language.

2- PHP-4 was powered by zend engine 1.0 where as PHP-5 was powered by zend engine 2.0

3- In PHP-4 everything is passed by value where as In PHP-5 all objects are passed by refference.

4- PHP-5 introduce a number of new magic function like _CALL, _GET, _SET and _TOSTRING

5- In PHP-5 it is possible you can declare a class as Abstract.

6- PHP-5 introduce a special function called _autoload.

7- PHP-5 removed register_global(), magic quotes and safe mode. 
This was due to the fact that register_global had opened security holes by allowing data injection.

8- PHP-5 introduce a new mysql extention named MYSQLI for developer in Mysql 4.1 and later version.

Happy Coding :)

Post a Comment

Previous Post Next Post