View Full Version : Can I Extend Class Without Definition?

12-31-2005, 05:45 AM
Can I do the following? It doesn't have definition of the child class.

class child extend parent;

Many thanks.

12-31-2005, 12:11 PM
Instead of asking, you could've simply tried it. But no, you cannot do it that way. However, you can do this:

class child extends parent {}Oh, and use "extends" instead of "extend", because PHP doesn't like it, if you use undefined keywords.


12-31-2005, 07:57 PM
Here is the PHP Documentation on Classes and Objects, it'll answer a lot of questions for you.

PHP 4 (http://www.php.net/manual/en/language.oop.php)
PHP 5 (http://www.php.net/manual/en/language.oop5.php)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum