|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-04-29 23:08 UTC] helly@php.net
[2004-04-29 23:11 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 15 00:00:01 2025 UTC |
Description: ------------ Just the check the following line in the reproduce code: if($it->isDir() && !$it->isDot() && $it->current() != 'CVS') { if you don't cast $it->current to a string it will output an error, so I need to write: if($it->isDir() && !$it->isDot() && (string) $it->current() != 'CVS') { This should really cast it to a string automatically. Reproduce code: --------------- <?php function recurse($it) { for( ; $it->valid(); $it->next()) { if($it->isDir() && !$it->isDot() && $it->current() != 'CVS') { echo $it->current() . "\n"; if($it->hasChildren()) { recurse($it->getChildren()); } } elseif($it->isFile() && $it->current() != '.cvsignore') { if(!php_check_syntax($it->current())) { echo $it->current(); } } } } recurse(new RecursiveDirectoryIterator('phpdoc/en')); ?> Actual result: -------------- Notice: Object of class RecursiveDirectoryIterator could not be converted to int eger in c:\cvs\recurse.php on line 4