php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39844 compile error empty(trim($var))
Submitted: 2006-12-15 16:02 UTC Modified: 2006-12-15 17:57 UTC
From: ppalka4 at abacus dot pl Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 4.4.4 OS: LINUX
Private report: No CVE-ID: None
 [2006-12-15 16:02 UTC] 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 '$

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-15 16:24 UTC] 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:38 UTC] 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 17:57 UTC] derick@php.net
This is NOT a bug. empty() only takes *variables*, not just values like trim() is returning. See http://php.net/empty
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 22 21:00:03 2025 UTC