php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8702 Nesting trim inside an empty wont parse
Submitted: 2001-01-14 16:32 UTC Modified: 2001-01-14 16:37 UTC
From: bob at bravenet dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.4 OS: Linux rh6.2
Private report: No CVE-ID: None
 [2001-01-14 16:32 UTC] bob at bravenet dot com
if ( empty(trim($str)) ) {
	echo "BUG";
} else {
	echo "WORKS";
}

Dont really need all the echo's since it never gets past a syntax check for the empty(trim()) part. I have to assume its a bug since logically, it shouldnt give a parser error.

Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /website/main/test.php on line 2

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-14 16:37 UTC] rasmus@php.net
As per the documentation empty() has no meaning for anything other than a variable.  You can't pass it an expression.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 08:01:28 2024 UTC