php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69167 call_user_func does not support references anymore
Submitted: 2015-03-03 07:54 UTC Modified: -
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: cweiske@php.net Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: master-Git-2015-03-03 (Git) OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cweiske@php.net
New email:
PHP Version: OS:

 

 [2015-03-03 07:54 UTC] cweiske@php.net
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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-03-03 10:18 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7ad6711a4dcb092e2125d36ec623f38a22153e73
Log: Fixed bug #69167 (call_user_func does not support references anymore)
 [2015-03-03 10:18 UTC] laruence@php.net
-Status: Open +Status: Closed
 [2016-07-20 11:39 UTC] davey@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7ad6711a4dcb092e2125d36ec623f38a22153e73
Log: Fixed bug #69167 (call_user_func does not support references anymore)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC