Edit report at http://bugs.php.net/bug.php?id=52966&edit=1
ID: 52966 Updated by: cataphr...@php.net Reported by: grzegorz at securelink dot pl Summary: No error with endless dir() -Status: Open +Status: Bogus Type: Bug Package: Directory function related Operating System: Linux PHP Version: 5.3.3 Block user comment: N New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2010-10-01 22:11:28] cataphr...@php.net PHP cannot guess what you want to do and warn you if the code you write doesn't do it. It's your responsibility to write correct programs. ------------------------------------------------------------------------ [2010-10-01 20:27:03] grzegorz at securelink dot pl Description: ------------ Hi! I writted buggy code and php engine crashed. Test script: --------------- function list_dir($dir) { $d = dir($dir); while (false !== ($entry = $d->read())) { if(is_dir($entry)) { if($entry != "." && $entry != "..") { continue; } list_dir("$dir/$entry"); } else { echo "$dir/$entry\n"; } } } list_dir("/"); Expected result: ---------------- Hmm ... I want some error or warning. Actual result: -------------- PHP Warning: dir(/var/www/priv/./././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././ in /var/www/priv/dir_tree.php on line 3 Warning: dir(/var/www/priv/./././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././././././././././ ././././././././././././././././././././././././././././././././ in /var/www/priv/dir_tree.php on line 3 PHP Fatal error: Call to a member function read() on a non-object in /var/www/priv/dir_tree.php on line 4 Fatal error: Call to a member function read() on a non-object in /var/www/priv/dir_tree.php on line 4 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52966&edit=1