Extending classes in PHP
| From: | Kashidom Nenakh | Date: | Tue, 21 Sep 2010 00:39:06 +0000 |
| Subject: | Extending classes in PHP | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-8974@lists.php.net to get a copy of this message | ||
Hello,
There's nowhere to ask questions, so I'm gonna have to go through here.
I have to merge a class with another one. I tried extend, but no luck.
I have an active class ( $someName = new SomeClass () ) instance, and I want to append a single
function to it. This has to be done a few times.
With "class newClass extends SomeClass", I don't get anything added. If I
reinitialize the class as newClass, I lose all my data.
In JavaScript, this issue would be resolved in a matter of seconds. Unfortunately, this is PHP. To
me, it looks like there is no solution to this, but I might be looking in the wrong places (such as
php.net and google.com) for my answers.
If this is, at all, possible, please respond.
Kashidom Nenakh
Mantha Designs inc.
kashidom@manthadesigns.net
www.manthadesigns.net