On Thursday 30 October 2003 01:27 pm, Marek Kilimajer wrote: > Why? I guess because php is interpreted language and is parsed only > once, no preprocessor. Workaround is quite easy, use variable:
I thought that too, and tried it before posting to the list (it was at the bottom of my first email). Unfortunately when you do that you get and expecting T_STRING error. The same thing happens if you put the var in quotes. Why would it not parse the constant the first time? It does everywhere else. -Jackson > > <?php > > // settings to be set on install of the app > $MY_BASE_CLASS="base_class"; > define("MY_BASE_CLASSFILE","base_class.php"); > > // require the class file > require_once(MY_BASE_CLASSFILE); > > class my_child_class extends $MY_BASE_CLASS { > // yada yada > } > ?> > > Jackson Miller wrote: > > On Thursday 30 October 2003 12:29 pm, Marek Kilimajer wrote: > >>php is not c, you can't use constants this way. > > > > but why? Is there a work around? > > > > -Jackson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php