PHP4
- Passed by value only
- Duplicate an object by assigning it to another variable
- A constructor was simply a method that had the same name as the class itself
- Not support abstract class
- Not support interface
- Not support magic methods
- Not support final
PHP5
- Passed by value and passed by reference
- Duplicate an object by clone keyword
Function __clone(){
$this->obj = clone $this->obj;
} - It introduces a new unified constructor/destructor
__constructor
__destructor - It allows to declare a class as abstract
- Supports interfaces
- Supports Maic methods
__call, __get, __set and __toString - Use final keyword
- Supports exceptions
- Inclusions of visibility