php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43405 change in call_user_func() argument validation
Submitted: 2007-11-26 03:59 UTC Modified: 2007-11-26 11:43 UTC
From: m at digitalsandwich dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.3CVS-2007-11-26 (CVS) OS: linux 2.6.22-gentoo-r8
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: m at digitalsandwich dot com
New email:
PHP Version: OS:

 

 [2007-11-26 03:59 UTC] m at digitalsandwich dot com
Description:
------------
In PHP 5.2 it was possible to use call_user_func*() to call a non-static method statically. In the latest cvs code for PHP 5.3 this will now produce a warning and does not appear to call the function.

This looks like a regression of http://bugs.php.net/bug.php?id=26543

Reproduce code:
---------------
<?php

class A
{
        public function test()
        {
                echo get_class($this);
        }
}

class B extends A
{
        public function test()
        {
                call_user_func(array('parent', 'test'));
        }
}

$b = new B;
$b->test();

?>


Expected result:
----------------
B

Actual result:
--------------
Warning: call_user_func() expects parameter 1 to be valid callback, array given in /tmp/test6.php on line 15

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-11-26 09:44 UTC] jani@php.net
It's caused by the parameter parsing API. Perhaps that needs some fixing..
 [2007-11-26 11:43 UTC] jani@php.net
There's already a bug #43231 which is the same issue. Please don't submit same bug many times, search before submitting..
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 20 00:00:02 2025 UTC