note 93137 added to function.constant
| From: | aeiou at osu1 dot php dot net | Date: | Tue, 25 Aug 2009 10:50:08 +0000 |
| Subject: | note 93137 added to function.constant | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-159864@lists.php.net to get a copy of this message | ||
cory dot mawhorter @ ephective dot com
why would you do this? the function returns NULL if not defined so a simple bool cast would suffice.
Null is false when casted to boolean.
if ((bool)const('x'))
{
}
----
Server IP: 64.71.164.2
Probable Submitter: 81.149.243.173
----
Manual Page -- http://www.php.net/manual/en/function.constant.php
Edit -- https://master.php.net/note/edit/93137
Del: integrated -- https://master.php.net/note/delete/93137/integrated
Del: useless -- https://master.php.net/note/delete/93137/useless
Del: bad code -- https://master.php.net/note/delete/93137/bad+code
Del: spam -- https://master.php.net/note/delete/93137/spam
Del: non-english -- https://master.php.net/note/delete/93137/non-english
Del: in docs -- https://master.php.net/note/delete/93137/in+docs
Del: other reasons-- https://master.php.net/note/delete/93137
Reject -- https://master.php.net/note/reject/93137
Search -- https://master.php.net/manage/user-notes.php