Re: [PHP4BETA] Using classes from within other classes?
| From: | Stanislav Malyshev | Date: | Tue, 02 May 2000 10:30:15 +0000 |
| Subject: | Re: [PHP4BETA] Using classes from within other classes? | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-14339@lists.php.net to get a copy of this message | ||
SB>> Is it possible to use a php class from within another php class?
SB>> Said class includes the other class file before its own class
SB>> definition.
Certainly, it should be.
SB>>
SB>> I have a class file that attempts to include and use another
SB>> class, yet I get an error kinda like this...
SB>>
SB>> Fatal error: Cannot instantiate non-existent class:
SB>>
SB>> Expected behavior?
Err... If it gives no names, I suspect you did something like:
$f = new $ClassName, instead of:
$f = new ClassName
If it does give class name, maybe include wasn't really included, but the
warning was supressed (failed include, unlike require, is not a fatal
error, AFAIR).
Code example would clear the matters, surely...
--
Stanislav Malyshev stas@zend.com
+972-3-6139665