note 50676 added to keyword.extends
| From: | tomnezvigin at comcast dot net | Date: | Mon, 07 Mar 2005 01:19:58 +0000 |
| Subject: | note 50676 added to keyword.extends | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-86019@lists.php.net to get a copy of this message | ||
This may seem obvious, but check this scenario. You have a class folder:
+ class
--classA.php
--classB.php
--classC.php
--mainClass.php
Here... classA, classB, classC all extend the mainClass.
If you try to create a function that automatically includes all of the classes in a folder,
normally, they are included alphabetically.
When you try to instantiate classC, for example, you will get an error:
"Cannot inherit from undefined class mainClass"
EVEN IF you instantiate the mainClass before you instantiate all of the other classes.
In other words, make sure your primary class is included before all others.
----
Manual Page -- http://www.php.net/manual/en/keyword.extends.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+50676
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50676&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50676&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50676&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50676&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50676&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+50676&report=yes
Search -- http://master.php.net/manage/user-notes.php