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

Home » Imported messages » comp.lang.php » A little tip
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: A little tip [message #177501 is a reply to message #177492] Mon, 02 April 2012 21:43 Go to previous message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma:
Senior Member
Am 02.04.2012 15:40, schrieb Shelly:
> On 4/2/2012 8:27 AM, M. Strobel wrote:
>> Am 02.04.2012 14:15, schrieb Shelly:
>>> On 4/2/2012 4:22 AM, M. Strobel wrote:
>>>> Am 02.04.2012 09:42, schrieb "Álvaro G. Vicario":
>>>> > El 30/03/2012 19:02, Shelly escribió/wrote:
>>>> >> Here is something I jist came across, so I am passing it on:
>>>> >> ==========
>>>> >> $val= TRUE;
>>>> >> $val&= TRUE;
>>>> >> print ($val === TRUE) ? "Triple is true\n" : "Triple is false\n";
>>>> >> print ($val == TRUE) ? "Double is true\n" : "Double is false\n";
>>>> >>
>>>> >> Results in:
>>>> >> Triple is false
>>>> >> Double is true
>>>> >> ==========
>>>> >>
>>>> >> Who designed that? It is totally counter-intuitive.
>>>> >
>>>> > When trying to understand these subtleties, I find var_dump() more useful than
>>>> > plain
>>>> > echos. In this case:
>>>> >
>>>> > $val= TRUE;
>>>> > var_dump($val);
>>>> > $val&= TRUE;
>>>> > var_dump($val);
>>>> >
>>>> > ... prints:
>>>> >
>>>> > bool(true)
>>>> > int(1)
>>>> >
>>>> > ... which makes the result of loose and strict comparisons obvious.
>>>> >
>>>>
>>>> Yes, and then he could print http://de2.php.net/manual/en/types.comparisons.php and
>>>> nail it to the monitor.
>>>
>>> Now was that really necessary -- or do you just get a rise out of insulting people
>>> who try to be helpful?
>>>
>>
>> Insulting? The monitor, because I told you to nail the paper on it?
>
> Yes. A non-insulting way or responding, while giving the information, would have been
>
> "Yes, the complete information can be found at
> http://de2.php.net/manual/en/types.comparisons.php"
>

If you take words like that, have fun on Usenet.

/Str.
[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
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: session variable doesn't appear in side bar
Next Topic: Doubt regarding an array of references...
Goto Forum:
  

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

Current Time: Tue Nov 26 10:40:04 GMT 2024

Total time taken to generate the page: 0.04723 seconds