/ Published in: PHP
URL: http://php.net/manual/en/function.property-exists.php
Comes in handy for php magic functions such as __get and __set. This behaviour is fixed in php 5.3. Returns true also for private and protected properties using a reflectionclass
Expand |
Embed | Plain Text
private function _property_exists_safe($class,$prop) { $r = property_exists($class, $prop); if (!$r) { $x = new ReflectionClass($class); $r = $x->hasProperty($prop); } return $r; }
You need to login to post a comment.
