note 42175 added to function.method-exists
| From: | jpgiotatnospamifrance dot com at rn2 dot php dot net | Date: | Thu, 06 May 2004 11:42:57 +0000 |
| Subject: | note 42175 added to function.method-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-69275@lists.php.net to get a copy of this message | ||
a little difference :
to find a method of an object (instance of a class)
<?php
if (method_exists($myinstance,'themethod'))
echo 'ok';
?>
to find a method of a class (using the class name, not the instance of the class!)
<?php
if (is_callable(array('theclassname','themethod')))
echo 'ok';
?>
----
Manual Page -- http://www.php.net/manual/en/function.method-exists.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42175
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42175&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42175&report=yes
Search -- http://master.php.net/manage/user-notes.php