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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
10 + 8 = ?
Subscribe to this entry?

 
 [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: Fri May 10 16:01:32 2024 UTC