php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28576 __call not invoked by call_user_func
Submitted: 2004-05-30 13:18 UTC Modified: 2004-07-11 21:40 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: zmeigorin at comail dot ru Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 4.3.6 OS: Windows/Irrelevant?
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: zmeigorin at comail dot ru
New email:
PHP Version: OS:

 

 [2004-05-30 13:18 UTC] zmeigorin at comail dot ru
Description:
------------
http://bugs.php.net/bug.php?id=19859 seems to be the same, but for PHP5.

When using call_user_func/call_user_func_array, undefined methods are not handled by __call.

Reproduce code:
---------------
<?php
    class MyOverload {
        function __call($method,$args,&$return) {
            return $return = "__call result\n";
        }
    }
    
    overload('MyOverload');
    $obj =& new MyOverload;
    echo $obj->test();
    
    echo call_user_func(array($obj,'test'));

?>

Expected result:
----------------
__call result
__call result

Actual result:
--------------
__call result
Warning:  call_user_func(myoverload::test): First argument is expected to be a valid callback

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-30 22:40 UTC] jed at jed dot bz
Quoting from the manual:

WARNING
As this is an experimental extension, not all things work. There is no __call() support currently, you can only overload the get and set operations for properties. You cannot invoke the original overloading handlers of the class, and __set() only works to one level of property access.

Recommend bogus.
 [2004-07-11 21:40 UTC] sniper@php.net
See above.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 07:01:29 2024 UTC