|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-07-31 12:08 UTC] waldschrott@php.net
[2000-07-31 12:10 UTC] stas@php.net
[2000-07-31 12:11 UTC] waldschrott@php.net
[2000-07-31 12:12 UTC] waldschrott@php.net
[2000-08-04 11:05 UTC] hholzgra@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Mon Jun 15 10:00:01 2026 UTC |
this the classical example (from the maual) how to traverse files in the directory: $d = opendir ('.'); while ($file = readdir($d)) { print ("$file\n"); } closedir ($d); unfortunately this is wrong. if the directory contains file named '0', the "while" condition evaluates to false and the loop stops. the ugly workaround is to use something like while (! is_bool ($file = readdir ($d)) but of course I would prefer to be able to use the clear former syntax. My overall impression that the notion of what is true and what is false in the current php is somewhat broken.