...

View Full Version : Can I Extend Class Without Definition?



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

class child extend parent;

Many thanks.

dumpfi
12-31-2005, 01: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.

dumpfi

Kurashu
12-31-2005, 08: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