note 109905 added to recursivedirectoryiterator.construct

From: Date: Sun, 02 Sep 2012 09:54:51 +0000
Subject: note 109905 added to recursivedirectoryiterator.construct
Groups: php.notes 
Request: Send a blank email to php-notes+get-190412@lists.php.net to get a copy of this message
The two default flags are zero (virtual) as with my PHP versions (5.3 and 5.4). Which means you can not check if those are set or not with the & bitwise operator: <?php // CURRENT_AS_FILEINFO (0) // KEY_AS_PATHNAME (0) ### always FALSE ### $directoryIterator->getFlags() & RecursiveDirectoryIterator::CURRENT_AS_FILEINFO; ?> But this also allows that you can use other flags right ahead without repeating the default ones: <?php new RecursiveDirectoryIterator( '.', FilesystemIterator::UNIX_PATHS ); ?> There is no need to repeat the default flags. Please note that this is different to FilesystemIterator which has as well the SKIP_DOTS flag as default which is non-zero: <?php new RecursiveDirectoryIterator( '.', FilesystemIterator::SKIP_DOTS | FilesystemIterator::UNIX_PATHS ); ?> ---- Server IP: 69.147.83.197 Probable Submitter: 79.225.45.206 ---- Manual Page -- http://www.php.net/manual/en/recursivedirectoryiterator.construct.php Edit -- https://master.php.net/note/edit/109905 Del: integrated -- https://master.php.net/note/delete/109905/integrated Del: useless -- https://master.php.net/note/delete/109905/useless Del: bad code -- https://master.php.net/note/delete/109905/bad+code Del: spam -- https://master.php.net/note/delete/109905/spam Del: non-english -- https://master.php.net/note/delete/109905/non-english Del: in docs -- https://master.php.net/note/delete/109905/in+docs Del: other reasons-- https://master.php.net/note/delete/109905 Reject -- https://master.php.net/note/reject/109905 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#190412) next »