PHP/Reflection/method exists — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 10:07, 26 мая 2010
method_exists() function checks to see if a particular method, exists.
<source lang="html4strict">
Its syntax is: bool method_exists (object obj_name, string method_name) <?
class Car { var $fourWheel; function set() { $this->fourWeel = 1; } } $car = new Car; if (method_exists($car, "set")) : print "yes"; else : print "no"; endif;
?>
</source>