Bug #78042 [PATCH]: SplTempFileObject::isReadable() / SplTempFileObject::isWritable() return values
| From: | cmb@php.net | Date: | Mon, 04 Oct 2021 14:49:28 +0000 |
| Subject: | Bug #78042 [PATCH]: SplTempFileObject::isReadable() / SplTempFileObject::isWritable() return values | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-237017@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78042&edit=1
ID: 78042
Patch added by: cmb@php.net
Reported by: phansys at gmail dot com
Summary: SplTempFileObject::isReadable() /
SplTempFileObject::isWritable() return values
Status: Open
Type: Bug
Package: Filesystem function related
Operating System: Linux
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
The following pull request has been associated:
Patch Name: Fixed bug #78042
On GitHub: https://github.com/php/php-src/pull/4186
Patch: https://github.com/php/php-src/pull/4186.patch
Previous Comments:
------------------------------------------------------------------------
[2019-05-20 15:31:59]
The following pull request has been associated:
Patch Name: [SplTempFileObject] [bug#78042] SplTempFileObject::isReadable() /
SplTempFileObject::isWritable() return values
On GitHub: https://github.com/php/php-src/pull/4178
Patch: https://github.com/php/php-src/pull/4178.patch
------------------------------------------------------------------------
[2019-05-20 15:27:19] phansys at gmail dot com
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 this bug report at https://bugs.php.net/bug.php?id=78042&edit=1