#28576 [Opn->Bgs]: __call not invoked by call_user_func
| From: | sniper@php.net | Date: | Sun, 11 Jul 2004 19:40:42 +0000 |
| Subject: | #28576 [Opn->Bgs]: __call not invoked by call_user_func | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-62053@lists.php.net to get a copy of this message | ||
ID: 28576
Updated by: sniper@php.net
Reported By: zmeigorin at comail dot ru
-Status: Open
+Status: Bogus
-Bug Type: Scripting Engine problem
+Bug Type: Class/Object related
Operating System: Windows/Irrelevant?
PHP Version: 4.3.6
New Comment:
See above.
Previous Comments:
------------------------------------------------------------------------
[2004-05-30 22:40:38] 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-05-30 13:18:24] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28576&edit=1