Bug #78482 [Com]: fgets notice from 7.4-beta2: read of 8192 bytes failed with errno=9 Bad file d

From: Date: Sat, 31 Aug 2019 12:04:41 +0000
Subject: Bug #78482 [Com]: fgets notice from 7.4-beta2: read of 8192 bytes failed with errno=9 Bad file d
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222508@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78482&edit=1 ID: 78482 Comment by: julien dot boudry at gmail dot com Reported by: julien dot boudry at gmail dot com Summary: fgets notice from 7.4-beta2: read of 8192 bytes failed with errno=9 Bad file d Status: Not a bug Type: Bug Package: *General Issues Operating System: Windows 10 - Non Thread Safe PHP Version: 7.4.0beta4 Block user comment: N Private report: N New Comment: Indeed. But the documentation and especially the changelog of the beta2 were not clear to me, for this situation. Thank you very much. Previous Comments: ------------------------------------------------------------------------ [2019-08-31 11:32:12] nikic@php.net This is an intentional change. You are trying to read from a write-only stream, which is no longer silently ignored. This is mentioned in https://github.com/php/php-src/blob/77a0fa101ed59f05ea07b03adb1cb66962fc45e7/UPGRADING#L149-L150, though should probably be extended to also mention other file-system and functions. ------------------------------------------------------------------------ [2019-08-31 10:59:36] julien dot boudry at gmail dot com Description: ------------ Hi, From PHP 7.4-beta2 (it's working on beta1), the following notice appears on fgets : read of 8192 bytes failed with errno=9 Bad file descriptor in /in/TR1Bk on line 7 It also works on stable versions. https://3v4l.org/TR1Bk Test script: --------------- <?php $tempName = tempnam(sys_get_temp_dir(), 'test'); $handle = fopen($tempName, 'w'); $line = fgets($handle); fclose($handle); Actual result: -------------- Notice: fgets(): read of 8192 bytes failed with errno=9 Bad file descriptor in /in/TR1Bk on line 7 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78482&edit=1

« previous php.bugs (#222508) next »