Re: call_user_func
| From: | Gabor Hojtsy | Date: | Mon, 14 Jul 2003 15:04:14 +0000 |
| Subject: | Re: call_user_func | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969355190@lists.php.net to get a copy of this message | ||
Please submit this as a documentation problem at bugs.php.net, so we can follow the progress of your report.
Thanks,
Goba
Keppla wrote:
Hello there I think I found an undocumented behavior in the 'call_user_func' function in PHP version 4.3.1. All arguments are passed by value, even if you call a function that takes its arguments by reference. Here is my example: <?php function createString( &$arg ) { $arg = 'Hello World'; } // calling the function normally createString( $stdCall ); echo "<p>'createString($stdCall)' works: '$stdCall'</p>"; // calling the function by using a variable as functionname $funcName = 'createString'; $funcName( $varCall ); echo "<p>'$func($varCall)' works: '$varCall'</p>"; // calling the function by call_user_func call_user_func( 'createString', $userCall ); echo "<p>'call_user_func( 'createString', $userCall )' does not work: '$userCall'</p>"; ?> greetings Philipp Benjamin Köpchen