|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-08-12 13:34 UTC] johannes@php.net
-Status: Open
+Status: Bogus
[2010-08-12 13:34 UTC] johannes@php.net
[2010-08-12 13:53 UTC] v dot kholoshenko at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 18:00:01 2025 UTC |
Description: ------------ PHP allows to call protected static method in classes not inherited from class, that defines this method. See test script. We have two classes inherited from basic abstract class and we can call protected functions (defined abstract) of first class from second. Note, call_user_func caused error (works as expected). Test script: --------------- <?php abstract class A { abstract protected static function test(); } class B extends A { protected static function test() { return "abc"; } } abstract class C extends A { public static function do1() { return B::test();// Expected "Fatal error: Call to protected method..." } } echo C::do1(); // returns 'abc' Expected result: ---------------- Fatal error: Call to protected method B::test() from context 'C' Actual result: -------------- abc