note 53339 deleted from function.call-user-func-array by didou
| From: | didou@php.net | Date: | Fri, 03 Jun 2005 12:18:32 +0000 |
| Subject: | note 53339 deleted from function.call-user-func-array by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-89856@lists.php.net to get a copy of this message | ||
Note Submitter:
----
<?
class A {
function doit($what) {
print('<pre>');
print("***\n");
var_dump($what);
print_r($what);
print("$$$ => " . $what[0] . " " . $what[1]);
}
}
function doit($what) {
print('<pre>');
print("###\n");
var_dump($what);
print_r($what);
print("@@@ => " . $what[0] . " " . $what[1]);
}
// WRONG GUESS
call_user_func_array(array(new A(), "doit"), array("hello", "world"));
call_user_func_array("doit", array("hello", "world"));
// !!!! THIS ONE DOES WHAT I EXCPECT
call_user_func_array(array(new A(), "doit"), array(array("hello",
"world")));
call_user_func_array("doit", array(array("hello", "world")));
?>
bug or feature?
that's hell... PHP behaves very strangely sometimes :-(