Date: 04/05/00
- Next message: admin <email protected>: "[PHP-DEV] Bug #4045: Apache segfaults when PHP is loaded"
- Previous message: marek <email protected>: "[PHP-DEV] PHP 4.0 Bug #4044: while loop continues infinitely where it should cease"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
ID: 4044
Updated by: torben
Reported By: marek <email protected>
Status: Closed
Bug Type: Other
Assigned To:
Comments:
It is not an error under PHP to print a false value, which is all that the
print() statement here would be doing once readdir() started returning
false. Therefore, the loop continues. For instance, the following bit of
code should never print 'Didn't print false':
<?php
if ( print( false ) ) {
echo "Printed false<br>\n";
} else {
echo "Didn't print false<br>\n";
}
?>
The following should do what you want:
<?php
$DH = opendir(".");
while ( $dir_entry = readdir( $DH ) ) {
print "$dir_entry<br>\n";
}
?>
Full Bug description available at: http://bugs.php.net/?id=4044
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: admin <email protected>: "[PHP-DEV] Bug #4045: Apache segfaults when PHP is loaded"
- Previous message: marek <email protected>: "[PHP-DEV] PHP 4.0 Bug #4044: while loop continues infinitely where it should cease"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

