|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-07-17 07:51 UTC] derick@php.net
[2007-07-17 08:17 UTC] reto at buxaprojects dot com
[2007-07-23 23:13 UTC] helly@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 03:00:01 2025 UTC |
Description: ------------ I expected, that i cannot call a non-static method in a parent's parent class with ParentClassName::method() from a child class. But it works even on E_STRICT. I think this should be a bug! Reproduce code: --------------- class A { private $myVar; public function test() { $this->myVar = 'test'; echo 'A::test()' . "\n"; } } class B extends A { public function test() { echo 'B::test()' . "\n"; } } class C extends B { public function test() { echo 'C::test()' . "\n"; A::test(); } } $c = new C; $c->test(); Expected result: ---------------- Non-static method A::test() should not be called statically Actual result: -------------- C::test A::test