php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1603 "hallo" == (int) "hallo" returns 1
Submitted: 1999-06-26 08:40 UTC Modified: 1999-06-27 21:41 UTC
From: bleek at job dot de Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.9 OS: linux 2.2.3
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: bleek at job dot de
New email:
PHP Version: OS:

 

 [1999-06-26 08:40 UTC] bleek at job dot de
<?
class Language {

  function Language($page=0){
     $page="test";                
     $page="test";
     print $page == (int) $page;      # returns 1 ???????
     print $page." == ".(int) $page;      
  }
}

$test=new Language();
?>

<?
$page="test";                
$page="test";
print $page == (int) $page;		# returns 0
print $page." == ".(int) $page; 
?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-06-27 21:41 UTC] sas at cvs dot php dot net
That's correct. It would be incorrect, if you could prove that 0 isn't 0.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Sep 20 10:00:01 2025 UTC