note 34481 added to function.empty
| From: | n031 at rack1 dot php dot net | Date: | Mon, 28 Jul 2003 21:46:28 +0000 |
| Subject: | note 34481 added to function.empty | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-52866@lists.php.net to get a copy of this message | ||
empty() used to function correctly upon CONSTANTS. As of 4.3?, it gives me errors if I try to use a
constant.
DEFINE("MYCONSTANTHASAVALUE", "it's O.S.C.A.R");
if ( empty(MYCONSTANTHASAVALUE) ) echo "Where's the beef?";
else "Your stomach cancer stick is secure.";
---------
This code snippet will work on php 4.2- (maybe 4.30 too). But it fails as of 4.3+.
I had to retool a lot of old code. Guess I'll stick to the much shorter ! sign
if ( !MYCONSTANTHASAVALUE ) ...
----
Manual Page -- http://www.php.net/manual/en/function.empty.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34481
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34481&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34481&report=yes