ID: 33806 Updated by: [EMAIL PROTECTED] Reported By: pascal dot parietti at fh-aargau dot ch -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: Linux, 2.6.11 PHP Version: 5.0.4 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Previous Comments: ------------------------------------------------------------------------ [2005-07-21 15:25:31] pascal dot parietti at fh-aargau dot ch Description: ------------ A static function in the base class (A) can execute a protected function in a derived class (B). If the same function is called from outside of class A the PHP Fatal error occurs as excepted. The error also occurs with the CVS Snapshot php5-STABLE-200507211237 compiled with ./configure && make Reproduce code: --------------- <?php class A { public static function test() { $a = new B(); $a->test2(); # why does this work? } } class B extends A { protected function test2() { echo "B: test2 \n"; } } A::test(); $b = new B(); # call a protected function -> PHP Fatal error as excepted: $b->test2(); ?> Expected result: ---------------- PHP Fatal error: Call to protected method B::test2() on line 5 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33806&edit=1