note 117317 added to function.empty
| From: | me at ruslanbes dot com | Date: | Wed, 20 May 2015 15:48:43 +0000 |
| Subject: | note 117317 added to function.empty | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-202622@lists.php.net to get a copy of this message | ||
Note that before PHP 5.5 using empty() with constants will produce cryptic T_PAAMAYIM_NEKUDOTAYIM
error. The sample code:
<?php
define("GLASS", "half-full");
if (empty(GLASS)) {
echo "The glass is empty";
}
// Parse error: syntax error, unexpected ')', expecting T_PAAMAYIM_NEKUDOTAYIM in ... on
line 3
?>
----
Server IP: 72.52.91.14
Probable Submitter: 178.188.62.26
----
Manual Page -- http://php.net/manual/en/function.empty.php
Edit -- https://master.php.net/note/edit/117317
Del: integrated -- https://master.php.net/note/delete/117317/integrated
Del: useless -- https://master.php.net/note/delete/117317/useless
Del: bad code -- https://master.php.net/note/delete/117317/bad+code
Del: spam -- https://master.php.net/note/delete/117317/spam
Del: non-english -- https://master.php.net/note/delete/117317/non-english
Del: in docs -- https://master.php.net/note/delete/117317/in+docs
Del: other reasons-- https://master.php.net/note/delete/117317
Reject -- https://master.php.net/note/reject/117317
Search -- https://master.php.net/manage/user-notes.php