[php-src] Issue #21114: SplFileInfo has no method isWriteable()

[email protected] (JamesOlvertone)
Newsgroups php.bugs
Message-ID <[email protected]>
Issue: https://github.com/php/php-src/issues/21114
Author: JamesOlvertone

From manual page: https://php.net/class.recursivedirectoryiterator

---
The SplFileInfo Object has no isWriteable()-method:

$rdi = new RecursiveDirectoryIterator(__DIR__, FilesystemIterator::SKIP_DOTS);
$rit = new RecursiveIteratorIterator($rdi);

foreach ($rit as $fileinfo) {
  //fileinfo  is SplFileInfo-Object

  echo $fileinfo . ":" . PHP_EOL;

  $fileinfo->isDir();              // this method exists
  $fileinfo->isReadable();    // this too
  is_writeable($fileinfo);     // this works

  // error: PHP Fatal error:  
  //Uncaught Error: Call to undefined method SplFileInfo::isWriteable() 
  $fileinfo->isWriteable();   
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.