O'Reilly logo

PHP 5 Power Programming by Derick Rethans, Stig Sæther Bakken, Andi Gutmans

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

13.9. Summary

This chapter highlights some changes in PHP 5 that affect scripts written and working under PHP 4. A new object model and new OO features in PHP 5 mean that some OO scripts written for PHP 4 won't run correctly with PHP 5. If you cast an object to an int, the result is always 1, rather than 0 as in PHP 4. When you compare objects in PHP 5, true is returned only if the objects are the same, with the same object handle. The PHP 5 behavior for these three changes can be reverted to PHP 4 behavior by turning on Zend 1 compatibility mode in the php.ini file. However, two other changes cannot be reverted. In PHP 5, you can no longer assign an object to $this inside a class. In addition, the get_class() function in PHP 5 returns the class ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required