I understand PHP does not have a pure object variable, but I want to check whether a property is in the given object or class.
$ob = (object) array(\'a\' =&g
If you want to know if a property exists in an instance of a class that you have defined, simply combine property_exists() with isset().
property_exists()
isset()
public function hasProperty($property) { return property_exists($this, $property) && isset($this->$property); }