FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Implied cast differs from explicit cast
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Implied cast differs from explicit cast [message #176672 is a reply to message #176659] Mon, 16 January 2012 13:28 Go to previous messageGo to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma:
Senior Member
lb wrote:
> jstucklex(at)attglobal(dot)net wrote:
>> ...
>> No, it is not. '0x12' is a hex number, not an integer. (int)'0x12'
>> converts this correctly to 0.

Looks like Jerry doesn't know what an integer is either.

A hex number of course *is* an integer, unless its a hex representation
of floating point.

Killfile the prat like I have.


>
> OK, but if (int)'0x12' is 0, why is '0x12'+0 == 18?
>
> Why are they different? Aren't they both doing 'string conversion to number'?

Don't expect Jerry to have a clue

because its either an integer number or a non numeric string?

I have given up trying to second guess PHP in casting.

One keeps things very simple as with a 2 year old (or jerry) when using PHP.

It can understand 18

It can understand 'eighteeen'

Lord knows what it does with '18'


As for 0x12...man, you are pushing the boat out, there.

Stop expecting PHP to be more than it is, a quick hack that writes good
web pages faster than almost anything else.

If you want a language that has a rule set and sticks to it rigidly,
that's C.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Open Source Development
Next Topic: error from phpadmin
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 19:26:24 GMT 2024

Total time taken to generate the page: 0.05411 seconds