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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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: Mon Dec 30 14:01:28 2024 UTC