php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10715 -0 Returns true as an integer
Submitted: 2001-05-07 15:04 UTC Modified: 2001-08-06 19:45 UTC
From: pillaged at hotmail dot com Assigned:
Status: Not a bug Package: Math related
PHP Version: 4.0.5 OS: Debian GNU/Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: pillaged at hotmail dot com
New email:
PHP Version: OS:

 

 [2001-05-07 15:04 UTC] pillaged at hotmail dot com
$number = -0;
	if (is_integer($number) == true) 
		{
    echo "number is an integer";
	}
	else {
	    echo "number is not an integer";
	}

/* -0 just generally works as a number it probably shouldn't */ 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-22 15:48 UTC] andy@php.net
I believe this is probably because the negative sign is
stripped from -0, so the variable just reads 0 (which is an
integer.)  Can anybody else verify this?
 [2001-08-06 19:45 UTC] jeroen@php.net
-0 is just a strange way of writing 0
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 13 11:01:28 2024 UTC