From:             [EMAIL PROTECTED]
Operating system: Any
PHP version:      4.0.4pl1
PHP Bug Type:     Feature/Change Request
Bug description:  function to get constant values by variable name

I believe PHP lacks a function to get constant values by
name where the constant's name is stored in a string variable.

What I mean is something like

function get_constant($const_name)
        eval ("\$myvar = " . $const_name . ";");
        return $myvar;

but I really think that using eval() here is a waste.

Am I missing something?


Edit Bug report at:

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to