Doc #63998 [NEW]: At least since PHP 5.3.10 parameters not by reference in call_user_func_array
| From: | vtamara at pasosdeJesus dot org | Date: | Tue, 15 Jan 2013 21:10:39 +0000 |
| Subject: | Doc #63998 [NEW]: At least since PHP 5.3.10 parameters not by reference in call_user_func_array | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-9408@lists.php.net to get a copy of this message | ||
From: vtamara at pasosdeJesus dot org
Operating system:
PHP version: 5.3.20
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:At least since PHP 5.3.10 parameters not by reference in call_user_func_array
Description:
------------
---
From manual page:
http://www.php.net/function.call-user-func-array#refsect1-
function.call-user-func-array-notes
---
The test script under PHP 5.2.17 produces the expected result shown below.
However at least with PHP 5.3, it produces the actual result shown.
This change in behavior from PHP 5.2 to PHP 5.3 is not documented (it is
documented for PHP 5.4).
Test script:
---------------
function x(&$a) {
return array('x');
}
$y = 'y';
echo "1\n"; var_dump(x($y));
echo "2\n";
var_dump(call_user_func_array('x', array($y)));
Expected result:
----------------
1
array(1) {
[0]=>
string(1) "x"
}
2
array(1) {
[0]=>
string(1) "x"
}
Actual result:
--------------
1
array(1) {
[0]=>
string(1) "x"
}
2
PHP Warning: Parameter 1 to x() expected to be a reference, value given in
/home/vtamara/comp/php/callback.php on line 10
NULL
--
Edit bug report at https://bugs.php.net/bug.php?id=63998&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63998&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63998&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63998&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=63998&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=63998&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=63998&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=63998&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=63998&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=63998&r=support
Expected behavior: https://bugs.php.net/fix.php?id=63998&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=63998&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=63998&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=63998&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63998&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=63998&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=63998&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=63998&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63998&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=63998&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=63998&r=mysqlcfg