note 28705 deleted from function.function-exists by didou
| From: | didou@php.net | Date: | Thu, 29 May 2003 22:51:16 +0000 |
| Subject: | note 28705 deleted from function.function-exists by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-49375@lists.php.net to get a copy of this message | ||
Note Submitter: bisqwit@iki.fi
----
[Editor's Note]
It is recommended to use PHP's built-in method_exists() function for this.
[/Note]
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";