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
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: 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-2025 The PHP Group
All rights reserved.
Last updated: Sun Apr 27 21:01:26 2025 UTC