|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-10-31 19:19 UTC] sniper@php.net
[2001-11-21 13:19 UTC] sander@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 05:00:01 2025 UTC |
Code: -- ClassA.php contents ---------------------------------- <?php class A { function Test() { echo "A::Test\n"; } } ?> -- Test.php contents ------------------------------------ <?php include_once('ClassA.php'); class B extends A { function Test() { parent::Test(); } } B::Test(); ?> --------------------------------------------------------- Try to execute Test.php - for example, type php.exe -q Test.php - i recieved application error message on this. The problem seems to be in a buggy parent resove algorithm. On such a cases it incorrectly resolves parent - to class itself (it results in infinite recursion) or raises an exception ("the memory coudn`t be read"). This problem can be "solved" by using real parent`s class name except "parent::", or by doing all such includes "on the same level" -- if some class is included (by include, require, include_once, require_once), all their child classes must be included before the line where parent is included.