Bug #69259 [Ver->Fbk]: One reference passing fail with call_user_func_array() causes other fails
| From: | laruence@php.net | Date: | Thu, 19 Mar 2015 08:19:41 +0000 |
| Subject: | Bug #69259 [Ver->Fbk]: One reference passing fail with call_user_func_array() causes other fails | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-191462@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69259&edit=1
ID: 69259
Updated by: laruence@php.net
Reported by: ryosuke_i_628 at yahoo dot co dot jp
Summary: One reference passing fail with
call_user_func_array() causes other fails
-Status: Verified
+Status: Feedback
Type: Bug
Package: *General Issues
PHP Version: Irrelevant
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2015-03-19 08:19:13] laruence@php.net
from what I can tell, it is by design, if the parameters checking is fail, the destination function
won't be called.
thus this behavior is expected.
thanks
------------------------------------------------------------------------
[2015-03-19 05:36:27] ryosuke_i_628 at yahoo dot co dot jp
Description:
------------
One reference passing fail with call_user_func_array() causes other fails.
HHVM is already fixed on this issue, however, PHP 7 still has this problem.
http://3v4l.org/jd9Nd
Test script:
---------------
<?php
function inc(&$a, &$b) {
++$a; ++$b;
}
$a = 1;
$b = 1;
$params = array($a, &$b);
call_user_func_array('inc', $params);
var_dump($params);
Expected result:
----------------
Warning: Parameter 1 to inc() expected to be a reference, value given in ... on line ...
array(2) {
[0]=>
int(1)
[1]=>
&int(2)
}
Actual result:
--------------
Warning: Parameter 1 to inc() expected to be a reference, value given in ... on line ...
array(2) {
[0]=>
int(1)
[1]=>
&int(1)
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69259&edit=1