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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bob at bravenet dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 22:01:27 2025 UTC