|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-09-12 08:48 UTC] dmitry@php.net
-Assigned To:
+Assigned To: dmitry
[2018-09-12 09:27 UTC] dmitry@php.net
[2018-09-12 09:27 UTC] dmitry@php.net
-Status: Assigned
+Status: Closed
[2018-09-12 09:27 UTC] dmitry@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 16:00:01 2025 UTC |
Description: ------------ In case protected method overrides a private one. PHP may bypass protected method accessibility check. Test script: --------------- <?php class A { private function f() { return "A"; } } class B extends A { protected function f() { return "B"; } } $b = new B(); try { var_dump($b->f()); } catch (Throwable $e) { echo "Exception: ", $e->getMessage(), "\n"; } ?> Expected result: ---------------- Exception: Call to protected method B::f() from context '' Actual result: -------------- string(1) "B"