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
 [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

Pull Requests

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: Sat Dec 28 03:01:28 2024 UTC