aspose file tools*
The moose likes PHP and the fly likes equivalence relation, makes no sense here Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » PHP
Bookmark "equivalence relation, makes no sense here" Watch "equivalence relation, makes no sense here" New topic
Author

equivalence relation, makes no sense here

colin shuker
Ranch Hand

Joined: Apr 11, 2005
Posts: 744
Hi, I'm confused...

10 === 10.0 is FALSE, because different data types (int and float)

But when I do..
$a = 10;
$b = 10.0;

$a === $b is TRUE, but they have different data types, don't they?

I did echo gettype(10.0); and this says double.

Can anyone explain, I need to clear this up. Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61606
    
  67

Please KeepItDown


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
colin shuker
Ranch Hand

Joined: Apr 11, 2005
Posts: 744
Nevermind, I found an error in my code, $b = &$a, which made the types the same.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: equivalence relation, makes no sense here