src/FileInfo.php
public function changeExtension($extension)
    {
        $pathname = $this->createPathname($this->getPath(), $this->getBasename(), $extension);

        return new static($pathname);
    }
public function changeExtension($extension)
    {
        $pathname = $this->createPathname($this->getPath(), $this->getBasename(), $extension);

        return new static($pathname);
    }
public function changeExtension ( $ extension ) { $ pathname = $ this -> createPathname ( $ this -> getPath ( ) , $ this -> getBasename ( ) , $ extension ) ; return new static ( $ pathname ) ; }
Changes file extension.

@param string $extension

@return FileInfo
Changes file extension .