php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47885 expr in empty() causes parse error
Submitted: 2009-04-03 10:01 UTC Modified: 2009-04-03 10:52 UTC
From: ninzya at inbox dot lv Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.3.0RC1 OS: Any
Private report: No CVE-ID: None
 [2009-04-03 10:01 UTC] ninzya at inbox dot lv
Description:
------------
expr in empty() causes parse error

Reproduce code:
---------------
<?php

if( empty( $x =5)) {
}

?>

Expected result:
----------------
No parse errors

Actual result:
--------------
Parse error

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-03 10:52 UTC] felipe@php.net
Says the documentation:
"Note: empty() only checks variables as anything else will result in a parse error. In other words, the following will not work: empty(trim($name))." -- http://docs.php.net/empty
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Aug 07 09:00:03 2025 UTC