anybody here know what the logic is behind constant() triggering a warning
if the named constant is not found?

contrived example:

<?

$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
}

PLEASE - nobody need bother to tell me about the @ operator, I am
aware of it but I don't want to use it in this case.


thanks & rgds,
jochem

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to