|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-11-06 12:49 UTC] frajper at gmail dot com
Description:
------------
In the same file, you cannot instanciate an object of a child-class that extends an abstract one before the child-class has been defined.
// The following code does not work //
$s = new Son ();
abstract class Bird {}
class Father extends Dove {}
Reproduce code:
---------------
Fatal error: Class 'Import_ald' not found in /home/enric00/no_public/import/Import_ald.php on line 7
Expected result:
----------------
Normal execution
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 21 06:00:01 2025 UTC |
Excuse me, but I did a mistake while writing the report. The correct one is as follows: // The following code does not work // $s = new Dove(); abstract class Bird {} class Father extends Dove {}Excuse me again, this is the goog one. (Sorry) // The following code does not work // $s = new Dove(); abstract class Bird {} class Dove extends Bird{}