Bug #69259 [NEW]: One reference passing fail with call_user_func_array() causes other fails

From: Date: Thu, 19 Mar 2015 05:36:28 +0000
Subject: Bug #69259 [NEW]: One reference passing fail with call_user_func_array() causes other fails
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191458@lists.php.net to get a copy of this message
From:             ryosuke_i_628 at yahoo dot co dot jp
Operating system: 
PHP version:      Irrelevant
Package:          *General Issues
Bug Type:         Bug
Bug description:One reference passing fail with call_user_func_array() causes other fails

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



Thread (5 messages)

« previous php.bugs (#191458) next »