#39844 [Opn->Bgs]: compile error empty(trim($var))
| From: | derick@php.net | Date: | Fri, 15 Dec 2006 17:57:04 +0000 |
| Subject: | #39844 [Opn->Bgs]: compile error empty(trim($var)) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-106405@lists.php.net to get a copy of this message | ||
ID: 39844
Updated by: derick@php.net
Reported By: ppalka4 at abacus dot pl
-Status: Open
+Status: Bogus
Bug Type: Compile Failure
Operating System: LINUX
PHP Version: 4.4.4
New Comment:
This is NOT a bug. empty() only takes *variables*, not just values like
trim() is returning. See http://php.net/empty
Previous Comments:
------------------------------------------------------------------------
[2006-12-15 16:38:48] ppalka4 at abacus dot pl
code below produce parse error but it ok
$wart=" hej ";
if(!empty(trim($wart)))
{
echo "NOT OK";
}
------------------------------------------------------------------------
[2006-12-15 16:24:43] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
.
------------------------------------------------------------------------
[2006-12-15 16:02:28] ppalka4 at abacus dot pl
Description:
------------
System Linux test2.abacus.pl 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003
i686
Build Date Nov 28 2006 11:45:15
Configure Command './configure' '--with-jpeg-dir=/usr/lib/'
'--enable-mbstring' '--with-mysql' '--enable-track-vars'
'--enable-ftp'
'--enable-sysshm' '--enable-sysvsem' '--with-gd'
'--with-zlib'
'--with-gettext' '--prefix=/usr/PHP'
'--with-apxs=/usr/Apache/bin/apxs'
'--prefix=/usr/PHP' '--enable-safe-mode'
Server API Apache
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/PHP/lib/php.ini
PHP API 20020918
PHP Extension 20020429
Zend Extension 20050606
Debug Build no
Zend Memory Manager enabled
Thread Safety disabled
Registered PHP Streams php, http, ftp, compress.zlib
Reproduce code:
---------------
$wart=" hej ";
$wart=trim($wart);
if(!empty($wart))
{
echo "WORKS";
}
/*
$wart=" hej ";
if(!empty(trim($wart)))
{
echo "PARSE ERROR";
}
*/
Expected result:
----------------
problem with compile program
$wart=" hej ";
if(!empty(trim($wart)))
{
echo "PARSE ERROR";
}
Actual result:
--------------
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or
'$
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39844&edit=1