Re: accessing a constant which name is stored in a variable

From: Date: Sun, 03 Sep 2000 21:17:47 +0000
Subject: Re: accessing a constant which name is stored in a variable
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-31849@lists.php.net to get a copy of this message
Out of pure interest... Why would you want this functionality? Just go: print my_constant;
I can´t because at I don´t know which constant I want to access at compile time.
You shouldn't be accessing constants through variables.
well I know, it´s already to late I´ve rewritten some parts (was not my code) and now I´m using some global variables, would have been fine.... also get_defined_constants() would have been fine, but now I´m not interested anymore :) perhaps someone thinks its useful though andré

« previous php.dev (#31849) next »