From:             HACGIS at gmail dot com
Operating system: Windows XP SP2
PHP version:      5.3CVS-2008-04-03 (snap)
PHP Bug Type:     Variables related
Bug description:  call_user_func_array pass arguments by reference

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 bug report at http://bugs.php.net/?id=44626&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=44626&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=44626&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=44626&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=44626&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=44626&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=44626&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=44626&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=44626&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=44626&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=44626&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=44626&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=44626&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=44626&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=44626&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=44626&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=44626&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=44626&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=44626&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=44626&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=44626&r=mysqlcfg

Reply via email to