|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-04-03 11:08 UTC] jani@php.net
[2010-11-19 10:58 UTC] chat dot noir at arcor dot de
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 21:00:01 2025 UTC |
Description: ------------ When a user function has some arguments which pass by reference, and use call_user_func_array to call the function, I find a bug. In PHP 5.2 the code doesn't have any warning, But in PHP 5.3 snap I get a warning. Reproduce code: --------------- function test(&$arg){ echo $arg; } $arg = 'OK<br>'; $arg_array1 = array(&$arg); $arg_array2 = array($arg); call_user_func_array('test', $arg_array1); // OK call_user_func_array('test', $arg_array2); // get Warning Expected result: ---------------- OK OK Actual result: -------------- OK Warning: Parameter 1 to test() expected to be a reference, value given in D:\DevWeb.bak\UserDir\test\index.php on line 9