filburt1
10-05-2005, 05:59 PM
PHP 4 has a function is_a() to check the class of an object (is_a($car, "Honda") for example)
PHP 5 has the operator instanceof to accomplish this ($car instanceof Honda, for example)
In PHP 5, is_a() is deprecated but still exists
In PHP 4, instanceof doesn't exist and is_a() is the only function available
So, just as you can tell if a function is defined, is there a way of determining if an operator such as instanceof is available? Or must I fall back to detecting the PHP version?
PHP 5 has the operator instanceof to accomplish this ($car instanceof Honda, for example)
In PHP 5, is_a() is deprecated but still exists
In PHP 4, instanceof doesn't exist and is_a() is the only function available
So, just as you can tell if a function is defined, is there a way of determining if an operator such as instanceof is available? Or must I fall back to detecting the PHP version?