I would like to check if a PHP object has a property. For PHP5 I could use
if (property_exists($object, "foo")) {...}
but how can I do the same in PHP4?
You can use get_object_vars
and check the resulting array if your property exists.
Please refer to the the documentation on get_object_vars
here: http://php.net/manual/en/function.get-object-vars.php