This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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


Win a copy of Building Microservices this week in the Design forum!
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: 750
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: 63232
    
  69

Please KeepItDown


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

Joined: Apr 11, 2005
Posts: 750
Nevermind, I found an error in my code, $b = &$a, which made the types the same.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: equivalence relation, makes no sense here
 
jQuery in Action, 3rd edition