Bug #78042 [NEW]: SplTempFileObject::isReadable() / SplTempFileObject::isWritable() return values

From: Date: Mon, 20 May 2019 15:27:19 +0000
Subject: Bug #78042 [NEW]: SplTempFileObject::isReadable() / SplTempFileObject::isWritable() return values
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220920@lists.php.net to get a copy of this message
From: phansys at gmail dot com Operating system: Linux PHP version: Irrelevant Package: Filesystem function related Bug Type: Bug Bug description:SplTempFileObject::isReadable() / SplTempFileObject::isWritable() return values Description: ------------ SplTempFileObject::isReadable() and SplTempFileObject::isWritable() are returning false regardless the resource is readable or writable. Test script: --------------- $file = new \SplTempFileObject(-1); $written = $file->fwrite('readable content'); $file->fflush(); $file->rewind(); var_dump($file->getFileInfo()->getPathname()); var_dump($file->valid()); var_dump($file->isReadable()); var_dump($file->fread($written)); var_dump($file->isWritable()); $written += $file->fwrite(' is writable'); $file->fflush(); $file->rewind(); var_dump($file->fread($written)); // @see https://3v4l.org/OEYn8 Expected result: ---------------- string(12) "php://memory" bool(true) bool(true) string(16) "readable content" bool(true) string(28) "readable content is writable" Actual result: -------------- string(12) "php://memory" bool(true) bool(false) string(16) "readable content" bool(false) string(28) "readable content is writable" -- Edit bug report at https://bugs.php.net/bug.php?id=78042&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=78042&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=78042&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=78042&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=78042&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=78042&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=78042&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=78042&r=needscript Try newer version: https://bugs.php.net/fix.php?id=78042&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=78042&r=support Expected behavior: https://bugs.php.net/fix.php?id=78042&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=78042&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=78042&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=78042&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=78042&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=78042&r=dst IIS Stability: https://bugs.php.net/fix.php?id=78042&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=78042&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=78042&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=78042&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=78042&r=mysqlcfg

« previous php.bugs (#220920) next »