From:             demiurg at terra dot es
Operating system: Windows XP Pro
PHP version:      5CVS-2003-12-29 (dev)
PHP Bug Type:     Zend Engine 2 problem
Bug description:  __call() doesn't work for class methods

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 bug report at http://bugs.php.net/?id=26739&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26739&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26739&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26739&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26739&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26739&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=26739&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=26739&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26739&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26739&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26739&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26739&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26739&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26739&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26739&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26739&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26739&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26739&r=float

Reply via email to