public function current()
    {
        // the logic here avoids redoing the same work in all iterations

        if (null === $subPathname = $this->subPath) {
            $subPathname = $this->subPath = (string) $this->getSubPath();
        }
        if ('' !== $subPathname) {
            $subPathname .= $this->directorySeparator;
        }
        $subPathname .= $this->getFilename();

        return new SplFileInfo($this->rootPath.$this->directorySeparator.$subPathname, $this->subPath, $subPathname);
    }
public function current()
    {
        // the logic here avoids redoing the same work in all iterations

        if (null === $subPathname = $this->subPath) {
            $subPathname = $this->subPath = (string) $this->getSubPath();
        }
        if ('' !== $subPathname) {
            $subPathname .= $this->directorySeparator;
        }
        $subPathname .= $this->getFilename();

        return new SplFileInfo($this->rootPath.$this->directorySeparator.$subPathname, $this->subPath, $subPathname);
    }
public function current ( ) { // the logic here avoids redoing the same work in all iterations if ( null === $ subPathname = $ this -> subPath ) { $ subPathname = $ this -> subPath = ( string ) $ this -> getSubPath ( ) ; } if ( '' !== $ subPathname ) { $ subPathname .= $ this -> directorySeparator ; } $ subPathname .= $ this -> getFilename ( ) ; return new SplFileInfo ( $ this -> rootPath . $ this -> directorySeparator . $ subPathname , $ this -> subPath , $ subPathname ) ; }
Return an instance of SplFileInfo with support for relative paths.

@return SplFileInfo File information
Return an instance of SplFileInfo with support for relative paths .