Doc #81067 [Ver->Csd]: fpassthru no false
Edit report at https://bugs.php.net/bug.php?id=81067&edit=1
ID: 81067
Updated by: git@php.net
Reported by: simbiat at outlook dot com
Summary: fpassthru no false
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: Filesystem function related
PHP Version: 8.0.6
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of saundefined (author) and web-flow (committer)
Revision: https://github.com/php/doc-en/commit/98f2a733bc07e1c6d8fddb1d865b09fd79bdbea2
Log: fpassthru error description (#628)
Previous Comments:
------------------------------------------------------------------------
[2021-05-22 19:43:55] simbiat at outlook dot com
That's fine, but this needs to be reflected in the manual.
------------------------------------------------------------------------
[2021-05-21 16:37:48] cmb@php.net
Prior to PHP 8.0.0, fpassthru() returned false if a resource was
passed which is not an open stream. As of PHP 8.0.0, a TypeError
is thrown instead. Cf. <https://3v4l.org/gNerI>.
------------------------------------------------------------------------
[2021-05-21 16:12:57] simbiat at outlook dot com
Description:
------------
According to https://www.php.net/manual/en/function.fpassthru.php
fpassthru can return false, even though definition is "fpassthru ( resource
$stream ) : int". So, there is a contradiction and it seems like in description, rather in
definition. Unless it's planned to replace Fatal Error with false return.
Expected result:
----------------
Correct description of return values is expected
Actual result:
--------------
Promises false in case of error.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81067&edit=1
Thread (4 messages)