|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75526 fread behavior change in 7.2
Submitted: 2017-11-14 18:43 UTC Modified: 2017-11-15 14:29 UTC
From: ryan dot brothers at gmail dot com Assigned:
Status: Duplicate Package: Streams related
PHP Version: 7.2.0RC6 OS: Linux
Private report: No CVE-ID: None
 [2017-11-14 18:43 UTC] ryan dot brothers at gmail dot com
I noticed the following behavior changed when using fread with stdin in PHP 7.2.  I think the new behavior is correct based on the manual page for fread, but I didn't see it noted as a change in the release notes unless I missed it.

When running the below script in CLI, enter the text "abc" and press enter.

In PHP 7.1, the script immediately exits and prints the line you entered.

In PHP 7.2, the script prompts you for another line of text.  You have to press Control-D to exit out of it, and then all lines are printed.

Test script:
echo fread(STDIN, 1000);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-11-14 18:53 UTC]
Maybe related to #75515?
 [2017-11-14 19:02 UTC] ryan dot brothers at gmail dot com
Yes, looks to be similar.
 [2017-11-15 14:29 UTC]
-Status: Open +Status: Duplicate
 [2017-11-15 14:29 UTC]
Closing, as indeed fixed in PHP-7.2 branch
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC