Comparing non-empty string and 0 - is this behavior to be expected?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looking at the following code

echo ('') ? 'T' : 'F';
echo ('!') ? 'T' : 'F';
echo (0) ? 'T' : 'F';
echo ('' == 0) ? 'T' : 'F';
echo ('!' == 0) ? 'T' : 'F';

the output is:

FTFTT

Is this behavior to be expected?

--
Jeremy O'Connor



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux