|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-08-17 12:12 UTC] mail at zabmix dot ru
-Summary: No version features php
+Summary: Private and protected methods are
called as public!
-Operating System: Any (Windows 10 and Ubuntu test)
+Operating System: Any
[2021-08-17 12:12 UTC] mail at zabmix dot ru
[2021-08-17 12:35 UTC] nikic@php.net
-Status: Open
+Status: Not a bug
[2021-08-17 12:35 UTC] nikic@php.net
[2021-08-17 12:35 UTC] nikic@php.net
-Type: Security
+Type: Bug
[2021-08-17 12:45 UTC] mail at zabmix dot ru
[2021-08-17 13:03 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 03:00:02 2025 UTC |
Description: ------------ Any method properties are ignored when called inside a __call function. Test script: --------------- class One { protected function cat() { return 'this is cat'; } } class Two extends One { private function dog() { return 'this is dog'; } public function __call($name, array $args = []) { return call_user_func_array([new Three, $name], $args) . PHP_EOL; } } class Three extends Two { public function bird() { return 'this is bird'; } } $my = new Two(); echo $my->cat(); echo $my->dog(); echo $my->bird(); Expected result: ---------------- I expect at least a scoping error