From:             [EMAIL PROTECTED]
Operating system: Windows
PHP version:      4.0.6
PHP Bug Type:     Scripting Engine problem
Bug description:  parent class isn`t correctly resolved when child class is included

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.

-- 
Edit bug report at: http://bugs.php.net/?id=13882&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to