Re: [Fwd: [PHP] constant() - php5]

From: Date: Fri, 01 Jul 2005 13:13:28 +0000
Subject: Re: [Fwd: [PHP] constant() - php5]
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-17056@lists.php.net to get a copy of this message
> <? > > $cnst = "DEBUG"; > > // what I want to do but can't > if ($dbg = constant($cnst)) { > // do stuff > } > > // the only real option, it seems - bit long winded to get round a stupid (IMHO) > if (defined($cnst) && ($dbg = constant($cnst))) { > // do stuff > } What is stupid with validating name before using it? p. -- Paweł Bernat; uselessness' lover; select'<asm'||chr(64)||'asm'||'.'||'flynet'||chr(46)||'pl>'as email; Slowly and surely the unix crept up on the Nintendo user ...

« previous php.internals (#17056) next »