PHP 8.5.0 Alpha 1 available for testing

Voting

: five minus four?
(Example: nine)

The Note You're Voting On

Mark Simon
5 years ago
Regarding the warning:

This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE.

Of course, this means that if you use:

<?php
if($entry = readdir($handle) == false)
?>

or

<?php
while($entry = readdir($handle))
?>

you may get a false false, as it were.

As far as I can tell, the only time this would actually occur is if you encounter an entry of 0.

According to

https://www.php.net/manual/en/language.types.boolean.php#language.types.boolean.casting

this appears to be the only string which will evaluate to false.

<< Back to user notes page

To Top