note 103041 added to function.call-user-func-array
| From: | tracid2008ATgooglemail dot com at osu1 dot php dot net | Date: | Tue, 22 Mar 2011 10:42:01 +0000 |
| Subject: | note 103041 added to function.call-user-func-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-178072@lists.php.net to get a copy of this message | ||
I think a better solution is to use ReflectionClass instead of call_user_func_array:
<?php
$rc = new ReflectionClass('SomeClass');
$class = $rc->newInstanceArgs(array('foo', 'bar'));
echo $class->doSomething();
?>
----
Server IP: 69.147.83.197
Probable Submitter: 93.130.63.23
----
Manual Page -- http://www.php.net/manual/en/function.call-user-func-array.php
Edit -- https://master.php.net/note/edit/103041
Del: integrated -- https://master.php.net/note/delete/103041/integrated
Del: useless -- https://master.php.net/note/delete/103041/useless
Del: bad code -- https://master.php.net/note/delete/103041/bad+code
Del: spam -- https://master.php.net/note/delete/103041/spam
Del: non-english -- https://master.php.net/note/delete/103041/non-english
Del: in docs -- https://master.php.net/note/delete/103041/in+docs
Del: other reasons-- https://master.php.net/note/delete/103041
Reject -- https://master.php.net/note/reject/103041
Search -- https://master.php.net/manage/user-notes.php