|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-06-15 10:46 UTC] Sjon at hortensius dot net
[2012-06-15 11:13 UTC] Sjon at hortensius dot net
[2013-01-02 11:01 UTC] sadasd at yahoo dot com
[2015-12-20 17:28 UTC] tpunt@php.net
[2015-12-20 17:29 UTC] tpunt@php.net
-Status: Open
+Status: Not a bug
[2015-12-20 17:29 UTC] tpunt@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 17:00:02 2025 UTC |
Description: ------------ I find PHP will call "__call" instead of "__callStatic" when I'm calling a non- exists static method from the class (Class A) which is the parent of current class (Class B). And if the class (Class C) is not the child of that class (Class A), the result will be correct. Test script: --------------- <?php class A { public function __call($name, $args) { echo "NO\n"; } public static function __callStatic($name, $args) { echo "YES\n"; } } class B extends A { public function test() { A::test(); } } class C { public function test() { A::test(); } } A::test(); $b = new B(); $b->test(); $c = new C(); $c->text(); Expected result: ---------------- YES YES YES Actual result: -------------- YES NO YES