|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-02-23 17:12 UTC] johannes@php.net
-Status: Open
+Status: Not a bug
[2013-02-23 17:12 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 09:00:01 2025 UTC |
Description: ------------ When the magic __call() form extends,It can't call the private or protected function of child class, and worse, it would have been to call its own. But I watch others magic like __set(), __get(), they will not be affected for work in child. Test script: --------------- class superTest { public function __call($func, $param) { echo "Is __call", PHP_EOL; $this->$func($param); } } final class test extends superTest { private function hello($i) { echo "hello,world - $i[0]", PHP_EOL; } /** It will call hello() , only once, everything is fine public function __call($func, $param) { echo "Is __call in Child", PHP_EOL; $this->$func($param); } */ } $test = new test(); $test->hello(1); Expected result: ---------------- Is __call Hello,world - 1 Actual result: -------------- Is __call Is __call Is __call Is __call Is __call Is __call Is __call ... // stack exception