RE: [PHP] extending a class

From: Date: Thu, 10 Apr 2003 19:36:41 +0000
Subject: RE: [PHP] extending a class
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-143389@lists.php.net to get a copy of this message
> Is it possible to extend a class using a variable for the base class? > > I.E. > > $base_class = 'base'; > > class new_class extends $base_class{ > > stuff > > } Maybe you could solve it by using eval() in some way? Just a thought, I'm not sure if the following works: eval("class new_class extends ".$base_class); { ... } I'm very skeptic though. ------------------------------- Emil Stenqvist <emil@evolve.se> http://dignitas.net/ +46 073 763 67 91

« previous php.general (#143389) next »