note 39279 deleted from function.call-user-func by betz
| From: | betz@php.net | Date: | Thu, 22 Jan 2004 20:52:35 +0000 |
| Subject: | note 39279 deleted from function.call-user-func by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-64042@lists.php.net to get a copy of this message | ||
Note Submitter: Kris Koskelin
----
I was trying to use this function to call a method of an already-instantiated object. I needed to
do this with the object itself, not simply call the class' method.
To accomplish this, I really avoided this particular function altogether like this:
<?
if ( method_exists($my_obj, $action) ){
return $my_obj->{$action}();
}
?>
I hope someone else finds this useful. Note that doing this allows you to pass params to the
function more-or-less in the same way you would to any other class method.