Doc #79965 [Opn->Ver]: Why does the manual say fread/fwrite changed in PHP 7.4?
Edit report at https://bugs.php.net/bug.php?id=79965&edit=1
ID: 79965
Updated by: cmb@php.net
Reported by: thiemo dot kreuz at wikimedia dot de
Summary: Why does the manual say fread/fwrite changed in PHP
7.4?
-Status: Open
+Status: Verified
Type: Documentation Problem
Package: *Directory/Filesystem functions
PHP Version: 7.4.9
Block user comment: N
Private report: N
New Comment:
The relevant commit is d59aac5[1]; the PHPTs show that some, but
not all return values in case of failure have been changed from
int(0) to bool(false).
[1] <http://git.php.net/?p=php-src.git;a=commit;h=d59aac58b3e7da7ad01a194fe9840d89725ea229>
Previous Comments:
------------------------------------------------------------------------
[2020-08-12 17:03:19] thiemo dot kreuz at wikimedia dot de
Description:
------------
---
From manual page: https://php.net/migration74.incompatible
---
Quote: "fread() and fwrite() will now return FALSE if the operation failed. Previously an empty
string or 0 was returned."
This is not correct, or at least misleading. Both functions are documented to return false in case
of a failure ever since. What changed in PHP 7.4? I tried to find the related code change, but all I
found are bugfixes. Does this section refer to a bugfix? Maybe there was a very specific failure
situation that was not reported via false?
TL;DR: Please re-write or remove this misleading section from the migration manual.
https://www.php.net/manual/en/migration74.incompatible.php#migration74.incompatible.core.fread-fwrite
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79965&edit=1
Thread (6 messages)