Posted by Paul Lautman on 01/09/07 16:13
David Gillen wrote:
> Paul Lautman said:
>> Heiko Richler wrote:
>>> if sub_page is 0 it sets page=5 ?
>>>
>> Yep it sure does.
>>
>> Thanks for the hint on the way that switch comares work.
>>
>> Wierd thing is that, whilst it seems to treat NULL as 0, if I put a
>> NULL test in befor ethe 0 one, it does not detect 0 as NULL.
>>
>> So it seems NULL = 0 but 0 != NULL.
>>
>>
> Not if I run this block of code.
> <?
> if(0 != NULL)
> {
> echo "0 is NOT equal to NULL<br>\n";
> }
> else
> {
> echo "0 is equal to NULL<br>\n";
> }
>
> if(NULL == 0)
> {
> echo "NULL is equal to 0<br>\n";
> }
> else
> {
> echo "NULL is not equal to 0<br>\n";
> }
>>
>
> Result is
> 0 is equal to NULL
> NULL is equal to 0
>
> D.
But I wasn't running that code. I was using switch.
Navigation:
[Reply to this message]
|