|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-02-01 13:21 UTC] cmb@php.net
-Status: Open
+Status: Duplicate
-Package: Doc Build problem
+Package: Scripting Engine problem
-Assigned To:
+Assigned To: cmb
[2021-02-01 13:21 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 14:00:01 2025 UTC |
Description: ------------ Derived classes of the same base class can access each other's protected method and protected property. Test script: --------------- class Base { protected function foo() { echo 'foo'; } } class A extends Base { } class B extends Base { public function bar() { $a = new A(); // in fact, it is ok, and will echo foo. // but I think it should not access $a->foo(); } } (new B())->bar();