note 28705 added to function.function-exists
| From: | bisqwit at iki dot fi | Date: | Tue, 21 Jan 2003 18:56:19 +0000 |
| Subject: | note 28705 added to function.function-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-42528@lists.php.net to get a copy of this message | ||
To see if there exists a method in the class,
use is_callable() instead of function_exists():
$funname = 'foobarfunc';
if(is_callable(Array($this, $funname)))
eval('$this->'.$funname.'();');
else
print "The sky just fell, ouch\n";
--
http://www.php.net/manual/en/function.function-exists.php
http://master.php.net/manage/user-notes.php?action=edit+28705
http://master.php.net/manage/user-notes.php?action=delete+28705
http://master.php.net/manage/user-notes.php?action=reject+28705