Today and tomorrow I am attending FrOSCon 2011. If you happen to live in the Cologne Bonn area and are interested on Opensource this is the event you have to come to. =)
Monthly Archives: August 2011
is_a() in PHP 5.3.7
Two days ago the new PHP version 5.3.7 was released. Since it fixed a few major security issues I installed it on one of my testing systems and began running a few programs to test stability and compatibility.
To my surprise one of the changes must have been essential. Many of the old tests relying on PEAR did produce failures because an autoloader was triggered and the handler I use in tests fails by default.
What happened? Well… is_a() was called with a string as first argument. Instead of just returning an error, it called the autoloader to load a class by the name of the string given.
Reading the release notes – again – I stumbled upon the following line:
Removed warning when argument of is_a() or is_subclass_of() is not a known class. (Stas)
Looking at the source code showed that this change was not only removing a warning message but also changing the semantics of is_a() to match that of is_subclass_of(). Thanks, PHP team!
I created a simple patch to match the previous behavior. If someone is interested, just ask.