ID: 26739
Comment by: ecentinela at gmail dot com
Reported By: demiurg at terra dot es
Status: Open
Bug Type: Feature/Change Request
Operating System: *
PHP Version: 5.0.0
New Comment:
Have been resolved this issue? There is some workaround?
Thanks
Previous Comments:
------------------------------------------------------------------------
[2003-12-29 08:07:21] [EMAIL PROTECTED]
__call() doesn't offer anything to distinguish between static and
dynamic calls. So we'd need a new magic function say __static_call().
For 5.0.0 we have a feature freeze already, so this might take a while.
------------------------------------------------------------------------
[2003-12-29 07:50:16] demiurg at terra dot es
Description:
------------
Hello,
I'm not sure whether it is a bug or a feature, so I just point this out
and you decide.
__class() method works like OK for objects, but completely fails when
calling a class method (see Reproduce Code).
P.S. Before sending this report, I did a search on "__call" and have
found 11 bugs, none of which describes the issue.
Thanks!
Reproduce code:
---------------
<?php
class a {
static function __call($method, $params) {
echo "Called $method(".implode(', ', $params).")\n";
}
}
$c = new a;
$c->test(1, 2, 3);
a::test(3, 2, 1);
?>
Expected result:
----------------
Called test(1, 2, 3)
Called test(3, 2, 1)
Actual result:
--------------
Called test(1, 2, 3)
Fatal error: Call to undefined method a::test() in a.php on line 12
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26739&edit=1