ID:               26739
 Updated by:       [EMAIL PROTECTED]
-Summary:          __call() doesn't work for class methods
 Reported By:      demiurg at terra dot es
 Status:           Open
-Bug Type:         Zend Engine 2 problem
+Bug Type:         Feature/Change Request
-Operating System: Windows XP Pro
+Operating System: *
-PHP Version:      5CVS-2003-12-29 (dev)
+PHP Version:      5.0.0
 New Comment:

__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.


Previous Comments:
------------------------------------------------------------------------

[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

Reply via email to