Req #10102 [Ana->Csd]: need a better error message when argument to empty() isn't a variable
| From: | jani@php.net | Date: | Wed, 01 Dec 2010 15:04:11 +0000 |
| Subject: | Req #10102 [Ana->Csd]: need a better error message when argument to empty() isn't a variable | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-156643@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=10102&edit=1
ID: 10102
Updated by: jani@php.net
Reported by: pulstar at mail dot com
Summary: need a better error message when argument to empty()
isn't a variable
-Status: Analyzed
+Status: Closed
Type: Feature/Change Request
-Package: Feature/Change Request
+Package: *General Issues
Operating System: *
PHP Version: 4CVS, 5CVS (2004-04-13)
-Assigned To:
+Assigned To: jani
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2001-04-02 05:06:17] hholzgra@php.net
empty() will only accept variables,
no expressions
the error message is a little misleading,
do i move this to feature requests:
"have a better error message when argument to
empty() isn't a variable"
------------------------------------------------------------------------
[2001-04-01 19:05:21] pulstar at mail dot com
Parse error: parse error, expecting `')''
in c:\site\home\news.php on line 21
Line 21: if(!empty($news->getField(url)))
Line 22: echo $news->getField(url);
What is wrong in this line?
I changed it to:
$thing=$news->getField(url);
if(!empty($thing))
echo $news->getField(url);
Now, it works fine. Weird...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=10102&edit=1