Re: variables and costants in class definition

From: Date: Sat, 18 Aug 2001 08:32:15 +0000
Subject: Re: variables and costants in class definition
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-1604@lists.php.net to get a copy of this message
[giancarlo pinerolo <giancarlo@navigare.net>] > I proposed this feature/enhancement to php: > > have the possibility to pass variables and constants in class > definitions > eg: > > class {_DB_CLASS} > { > ... > > or > > class {$myclass} extends {_BASE_CLASS} > { > ... > > I think this would solve many integration and installation problems, and > save a lot of coding for conditions, and turn arounds with factories and > wrapper objects for classnames etc. Some use certainly there would be.. > > But maybe I drunk too much pinot. What do you think? No can do. When Zend compiles your PHP script, it doesn't know anything about variables etc. But there is always eval() [shudder]. Apart from that, this sounds like an awful kludge to get around bad design, or something you should handle yourself by generating your code from a template (if you really, really need it). - Stig -- Stig Sæther Bakken <ssb@alltheweb.com> Fast Search & Transfer ASA, Trondheim, Norway

« previous php.pear.dev (#1604) next »