Page 1 of 1

Comparison Operator ( !== )

Posted: Mon Mar 31, 2003 1:14 pm
by dstefani
Ok, I'm stupid.

I use it, it works, but what is it really doing.
I can't find it in the manual other than in the readdir() section.

It seems it would mean NOT identical. But what about this:

Code: Select all

while (false !== ($file = readdir($handle)))
"while this statement is not false" right?

Can you point me to the description od this operator?

Thanks,

-D

Posted: Mon Mar 31, 2003 1:47 pm
by twigletmac
Check out:
http://www.php.net/manual/en/language.o ... arison.php
php.net wrote:$a !== $b -> Not identical -> TRUE if $a is not equal to $b, or they are not of the same type. (PHP 4 only)
Mac

Posted: Mon Mar 31, 2003 2:01 pm
by dstefani
Oh, like in the list I was looking at before I posted this.

See I told you I was stupid! ;>)

Thanks!

Posted: Mon Mar 31, 2003 5:00 pm
by lazy_yogi
anyone see an advantage of

Code: Select all

while (false !== ($file = readdir($handle)))
over

Code: Select all

while ($file = readdir($handle))

Posted: Mon Mar 31, 2003 5:18 pm
by volka
place a file called 0 in your directory and you will see ;)
or simply try

Code: Select all

<?php
$f = '0';
echo ($f) ? 'true' : 'false', ' ';
echo ($f !== FALSE) ? 'true' : 'false', ' ';
?>
despite that: no, not to my knowledge ;)