ID: 36134 Updated by: [EMAIL PROTECTED] Reported By: quick_defect at yahoo dot com -Status: Open +Status: Assigned Bug Type: SPL related Operating System: redhat PHP Version: 5.1.2 -Assigned To: +Assigned To: helly New Comment:
Assigned to the maintainer. Previous Comments: ------------------------------------------------------------------------ [2006-01-23 10:15:44] quick_defect at yahoo dot com Description: ------------ when I use DirectoryIterator::__construct to get a new DirectoryIterator, I found it do not throw exception when "" and NULL passed as argument. Reproduce code: --------------- <?php $max=mt_getrandmax(); $ar=array(1,2,3); $ite=new RecursiveArrayIterator($ar); $invalid=array("",new Exception,array(),$ite,$max+1,NULL,"/no/such/dir"); foreach($invalid as $p) { try { $ak=new DirectoryIterator($p); var_dump($ak->valid()); var_dump($ak->getPathname()); echo "I will never come out\n"; }catch(Exception $e) { echo "exception caught with parameter $p\n"; } } ?> Expected result: ---------------- exception caught with parameter "" exception caught with parameter Object id #2 exception caught with parameter Array exception caught with parameter Object id #1 exception caught with parameter 2147483648 exception caught with parameter NULL exception caught with parameter /no/such/dir Actual result: -------------- bool(false) bool(false) I will never come out exception caught with parameter Object id #2 exception caught with parameter Array exception caught with parameter Object id #1 exception caught with parameter 2147483648 bool(false) bool(false) I will never come out exception caught with parameter /no/such/dir ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36134&edit=1