defined() not working
| From: | Dan | Date: | Sun, 27 Feb 2000 15:52:15 +0000 |
| Subject: | defined() not working | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-11075@lists.php.net to get a copy of this message | ||
A while back I dropped a note about how to check if a constant was defined.
I was referred to the defined() function. I finally got around to making
some changes in the header files and found that
if (defined( SOME_CONSTANT ))
works regardless of whether or not I've used define( "SOME_CONSTANT", 1 );
So I have reverted all of my code to use
if (1 == SOME_CONSTANT)
I wish this function worked as it is documented. I further wish that a const
variable could be used. <sigh>