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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 21:01:29 2024 UTC