From:
Operating system: Ubuntu 11.04
PHP version: 5.3.6
Package: *General Issues
Bug Type: Bug
Bug description:Static methods invoke __call when called from within class
Description:
------------
When calling a non-existant static method within an objects method, php
invokes
_call instead of
__callStatic. When calling the same non-existant static method outside of
the
object, php correctly
invokes __callStatic.
It appears that this broke in php5.3.5 and is still broken in 5.3.6. It
works as
expected in 5.3.3,
however.
Test script:
---------------
class Test {
public function __call($method, $args) {
echo "call\n";
}
public static function __callStatic($method, $args) {
echo "callStatic\n";
}
public function testing() {
Test::fakeFunction();
}
}
$t = new Test;
$t->testing();
Test::fakeFunction();
Expected result:
----------------
// expected output
callStatic
callStatic
Actual result:
--------------
// output
call
callStatic
--
Edit bug report at https://bugs.php.net/bug.php?id=55311&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=55311&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=55311&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=55311&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=55311&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=55311&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=55311&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=55311&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=55311&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=55311&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=55311&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=55311&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=55311&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=55311&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=55311&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=55311&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=55311&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=55311&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=55311&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=55311&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=55311&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=55311&r=mysqlcfg