note 108396 deleted from splfileobject.construct by danbrown

From: Date: Thu, 10 May 2012 17:03:28 +0000
Subject: note 108396 deleted from splfileobject.construct by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-187638@lists.php.net to get a copy of this message
Note Submitter: David P. ---- I had a problem using SplFileObject on a windows system running win2k8r2 server and iis. Creating an SplFileObject from a directory results in a 500 internal server error and a "permission denied" in the error log. 

In my oppinion this is not a php error but a difference between directory handling on windows and unix systems.

<?php
$file = new SplFileObject($filename);

if($file->isDir() {
 echo "foo";
}
?>

will not work, but

<?php
if(is_dir($filename)) {
 $file = new SplFileObject($filename);
}
?>

will.

« previous php.notes (#187638) next »