Bug #44626 [Com]: call_user_func_array pass arguments by reference

From: Date: Fri, 19 Nov 2010 09:58:07 +0000
Subject: Bug #44626 [Com]: call_user_func_array pass arguments by reference
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-156215@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=44626&edit=1

 ID:                 44626
 Comment by:         chat dot noir at arcor dot de
 Reported by:        HACGIS at gmail dot com
 Summary:            call_user_func_array pass arguments by reference
 Status:             Bogus
 Type:               Bug
 Package:            Variables related
 Operating System:   Windows XP SP2
 PHP Version:        5.3CVS-2008-04-03 (snap)
 Block user comment: N
 Private report:     N

 New Comment:

Why is this a warning?

CONTINUING EXECUTION AFTER IGNORED CALLS IS EVIL

Sorry for the caps, but I really mean it. Please make this at least an
exception or fatal error until it is finally fixed.


Previous Comments:
------------------------------------------------------------------------
[2008-04-03 11:08:25] jani@php.net

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.



------------------------------------------------------------------------
[2008-04-03 09:47:59] HACGIS at gmail dot com

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


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=44626&edit=1


Thread (3 messages)

« previous php.bugs (#156215) next »