Results 1 to 8 of 8

What is the main difference between PHP 4 and PHP 5?

This is a discussion on What is the main difference between PHP 4 and PHP 5? within the Programming forums, part of the Web Designing & Development category; What is the main difference between PHP 4 and PHP 5?...

  1. #1
    Member
    Join Date
    Jun 2017
    Posts
    39

    Default What is the main difference between PHP 4 and PHP 5?

    What is the main difference between PHP 4 and PHP 5?

  2. #2
    Senior Member dennis123's Avatar
    Join Date
    Apr 2013
    Location
    Bangalore
    Posts
    2,568

    Default Re: What is the main difference between PHP 4 and PHP 5?

    Here is the main differences, PHP4 was powered by Zend Engine 1.0, while PHP5 was powered by Zend Engine II. Constructor have same name as the Class name in PHP4 while we can declare Constructor as _construct and Destructor as _destruct() in PHP5. ... PHP5 allows to declare a class as abstract while PHP4 not.

  3. #3
    Member
    Join Date
    May 2017
    Posts
    74

    Default Re: What is the main difference between PHP 4 and PHP 5?

    PHP5 allows to have static Methods and Properties in a class while PHP4 not.

  4. #4
    Member
    Join Date
    Jun 2017
    Posts
    63

    Default Re: What is the main difference between PHP 4 and PHP 5?

    Php 4 is a procedure-oriented language while PHP 5 is an object-oriented language.
    Moreover, in PHP 4, everything including objects, was passed by value but in PHP 5 everything is passed by reference.
    One more thing added in PHP 5 is that there are 3 levels of visibilities: Public, private and protected.

  5. #5
    Member
    Join Date
    Mar 2018
    Location
    Santa Clara, California, USA
    Posts
    40

    Default Re: What is the main difference between PHP 4 and PHP 5?

    PHP4 and PHP5 are two versions of PHP. PHP4 was released on May 22, 2000. It was powered by the Zend Engine 1.0. After various versions, the last version of PHP4, titles PHP4.4.9 was released in August 2008. After which it was announced that PHP4 will no longer be under development and no more security updates for the version will be released.


    On July 13, 2004, PHP5 was released. It was powered by Zend Engine II. It was an improvement over PHP4 and included various new features, such as improved support for object-oriented programming, the PHP Data Objects (PDO) extension, and numerous performance enhancements. The PDO extension defines a lightweight and consistent interface for accessing databases. Late static binding was added in version 5.3. PHP5 was also designed to be backward compatible with earlier versions of PHP and hence should result in little functionality being broken while converting from PHP4 to PHP5.

  6. #6
    Member
    Join Date
    Mar 2018
    Posts
    31

    Default Re: What is the main difference between PHP 4 and PHP 5?

    the main difference of version in the PHP, PHP 4 is powered by Zend engine 1.0 and PHP5 is powered by Zend Engine II,

  7. #7
    Senior Member
    Join Date
    Nov 2016
    Posts
    152

    Default Re: What is the main difference between PHP 4 and PHP 5?

    There are many major differences but it is just obvious. Whenever we get such an update we have lots of updates in most of all the features and more compatible and increased functionality as well.

  8. #8
    Member
    Join Date
    Jun 2017
    Posts
    63

    Default Re: What is the main difference between PHP 4 and PHP 5?

    The major difference between PHP4 and PHP5 is in PHP4, everything was passed by value, including objects whereas in PHP5, all objects are passed by reference.

    There are many more differences between PHP4 and PHP5 such as:



    • PHP5 includes additional OOP concepts than php4, like access specifiers , inheritance etc.
    • PHP5 replaced magic quotes with the addslashes() function in order to escape characters.
    • PHP5 introduces a number of magic methods, such as __call, __get, __set and __toString
    • PHP4 is more of a procedure language while PHP5 is object oriented.