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 Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or 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

Add a Patch

Pull Requests

Add a Pull Request

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: Tue Mar 19 05:01:29 2024 UTC