Bug #69167 [NEW]: call_user_func does not support references anymore
From: cweiske
Operating system:
PHP version: master-Git-2015-03-03 (Git)
Package: Unknown/Other Function
Bug Type: Bug
Bug description:call_user_func does not support references anymore
Description:
------------
Passing a string or array reference to call_user_func gives an array in
PHP 7, while it works fine in PHP 4 and PHP 5.
See http://3v4l.org/D9PjW#vphp7@20150101
Test script:
---------------
<?php
function l($m) {
echo $m . "\n";
}
$cb = 'l';
call_user_func($cb, 'hi');
$cb2 = &$cb;
call_user_func($cb2, 'hi2');
?>
Expected result:
----------------
hi
hi2
Actual result:
--------------
hi
Warning: call_user_func() expects parameter 1 to be a valid callback, no
array or string given in /in/D9PjW on line 10
--
Edit bug report at https://bugs.php.net/bug.php?id=69167&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69167&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69167&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69167&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69167&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69167&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69167&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69167&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69167&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69167&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69167&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69167&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69167&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69167&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69167&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69167&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69167&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69167&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69167&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69167&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69167&r=mysqlcfg
Thread (2 messages)
- cweiske@php.net