title: DirectoryIterator scan to exclude '.' and '..' directories still including them?
body: <p>In the script below, I'm trying to copy the folders that exist in the $base directory over to the $target directory. However, in my initial echo test, its returning the . and .. directories even though I'm trying to handle that exception in the conditional.</p>
  
  <p>What am I missing?</p>
  
  <pre><code>    $base = dirname(__FILE__).'/themes/';
      $target = dirname( STYLESHEETPATH );
      $directory_folders = new DirectoryIterator($base); 
      foreach ($directory_folders as $folder) 
      {
           if ($folder-&gt;getPath() !== '.' &amp;&amp; $folder-&gt;getPath() !=='..' ) 
           {
              echo '&lt;br&gt;getPathname: '. $folder-&gt;getPathname();
              //copy($folder-&gt;getPathname(), $target);
           }
      }die;
  </code></pre>
  
  <p>However, and this makes no sense to me, if I change the conditional to...</p>
  
  <pre><code>         if (!is_dir($folder) &amp;&amp; $folder-&gt;getPath() !== '.' &amp;&amp; $folder-&gt;getPath() !=='..' ) 
  </code></pre>
  
  <p>It returns the correct folders inside of $base. What?</p>