PHP 4.0 Bug #8565: parent:: only works when both classes in the same file.

From: Date: Fri, 05 Jan 2001 17:22:36 +0000
Subject: PHP 4.0 Bug #8565: parent:: only works when both classes in the same file.
Groups: php.dev 
Request: Send a blank email to php-dev+get-43055@lists.php.net to get a copy of this message
From: jalal@php.net Operating system: Linux Suse 6.4 PHP version: 4.0.4 PHP Bug Type: Scripting Engine problem Bug description: parent:: only works when both classes in the same file. the parent:: operator will work if both the parent and sub class are in the same physical file, but not if they are in a separate file. This works: <?php class Base { function doit() { echo "Class Base->doit()\n"; } } class A extends Base { function doit() { parent::doit(); echo "Class A->doit()\n"; } } ?> but if the two classes are in separate files, the following error is reported: Fatal error: No parent class available in this context in a.inc on line 6 Of course, this may be an undocumented feature, but I can see no reason for it. -- Edit Bug report at: http://bugs.php.net/?id=8565&edit=1

« previous php.dev (#43055) next »