php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11627 string '0' treated as empty
Submitted: 2001-06-23 07:54 UTC Modified: 2001-06-24 12:16 UTC
From: vgo at nrd dot lt Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: 4.0.5 OS: Windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
2 + 33 = ?
Subscribe to this entry?

 
 [2001-06-23 07:54 UTC] vgo at nrd dot lt
the string '0' is not empty but treated as empty

if( empty( '0' ) )
{

}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-23 14:29 UTC] sniper@php.net
Yes, this is intentional. Check the manual page for it:

http://www.php.net/empty


 [2001-06-24 12:16 UTC] brianlmoon@php.net
Actually, you should get an error on that line.

empty takes a variable, not a value.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 03 07:01:32 2024 UTC