ID: 45186
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Open
+Status: Assigned
Bug Type: Scripting Engine problem
PHP Version: 5.3CVS-2008-06-05 (CVS)
-Assigned To:
+Assigned To: felipe
Previous Comments:
------------------------------------------------------------------------
[2008-06-05 12:26:12] [EMAIL PROTECTED]
Description:
------------
The magic method __call depends on __callstatic to be called in *class
scope*.
Adding:
static public function __callstatic($a, $b) {
print "__callstatic:\n";
var_dump($a);
}
The __call is called. Therefore, why dependency on __callstatic?
Reproduce code:
---------------
<?php
class bar {
public function __call($a, $b) {
print "__call:\n";
var_dump($this);
}
public function test() {
self::ABC();
bar::ABC();
call_user_func(array('bar', 'abC'));
}
}
$x = new bar;
$x->test();
Expected result:
----------------
__call:
object(bar)#1 (0) {
}
__call:
object(bar)#1 (0) {
}
__call:
object(bar)#1 (0) {
}
Actual result:
--------------
__call:
object(bar)#1 (0) {
}
__call:
object(bar)#1 (0) {
}
Warning: call_user_func() expects parameter 1 to be a valid callback,
class 'bar' does not have a method 'abc' in ...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45186&edit=1