On Pierre's weblog today he has this quick post about an issue he's seeing with instanceof when defining classes in PHP.
The problem is that it raises a fatal error if the tested class does not exist, making instanceof useless in sanity checks or other usages in unknown environment (compiled libs, libs used by a lot of people and have to be as safe as possible (no fatal error for instance).
Since the introduction of instanceof (which is a good thing, works well with the new OO apis), is_a is deprecated. It is obvious as its usage could be replaced by instanceof.
Thanks to some quick thinking (and a patch) on his part, the problem has been corrected and works without the error message...




