Why is this not possible?
if(!empty( _MY_CONST)){
...
But yet this is:
$my_const = _MY_CONST;
if(!empty($my_const)){
...
define( 'QUOTA_MSG' , '' ); // There is currently no message to show
$message = QUOTA_MSG;
if(!empty($message)){
echo $message;
}
I just wanted to make it a little cleaner by just referencing the constant itself.
See the manual:
empty()is a language construct, not a function.So you’ll have to use a variable –
empty()is really what you want in the first place? It would return true when the constant’s value is “0” for example.Maybe you need to test for the existence of the constant using
defined()instead?