class a extends $b?
| From: | Dan Libby | Date: | Sat, 27 Nov 1999 23:00:24 +0000 |
| Subject: | class a extends $b? | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-6980@lists.php.net to get a copy of this message | ||
I'm using PHP4, beta 2. For cobranding purposes, I would like to have
classes inherit from other classes in a dynamic fashion. Ideally, it
would work like this:
class a;
class b;
class c;
$myclass = "a";
class bar extends $myclass;
class foo extends bar;
Unfortunately, php tells me it is expecting a string in place of
$myclass. I then tried to do this:
define("myclass", "a");
class bar extends myclass;
That also failed, this time with no error message.
So, question 1: Anyone know of a way to do this? I've thought of using
conditional includes, but that has its own set of problems.
Question 2: If not, is this in beta 3, or any chance of making it into
final release?
thx.
-dan