note 107476 added to functions.anonymous
| From: | yuriy at internetcommerce dot ca | Date: | Sat, 11 Feb 2012 23:18:39 +0000 |
| Subject: | note 107476 added to functions.anonymous | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-186070@lists.php.net to get a copy of this message | ||
Expanding on the previous post. You do not need __call() function. Just call call_user_func_array()
function directly as in the example below.
class foo {
public $test;
public function __construct(){
$this->test = function($a) {
print $a;
};
}
}
$f = new foo();
call_user_func_array($f->test, array('d'));
----
Server IP: 72.55.140.6
Probable Submitter: 24.203.143.225
----
Manual Page -- http://www.php.net/manual/en/functions.anonymous.php
Edit -- https://master.php.net/note/edit/107476
Del: integrated -- https://master.php.net/note/delete/107476/integrated
Del: useless -- https://master.php.net/note/delete/107476/useless
Del: bad code -- https://master.php.net/note/delete/107476/bad+code
Del: spam -- https://master.php.net/note/delete/107476/spam
Del: non-english -- https://master.php.net/note/delete/107476/non-english
Del: in docs -- https://master.php.net/note/delete/107476/in+docs
Del: other reasons-- https://master.php.net/note/delete/107476
Reject -- https://master.php.net/note/reject/107476
Search -- https://master.php.net/manage/user-notes.php