php.net |  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ryan dot brothers at gmail dot com
New email:
PHP Version: OS:

 

 [2017-11-14 18:43 UTC] ryan dot brothers at gmail dot com
Description:
------------
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:
---------------
<?php
echo fread(STDIN, 1000);
exit;



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-11-14 18:53 UTC] kelunik@php.net
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] remi@php.net
-Status: Open +Status: Duplicate
 [2017-11-15 14:29 UTC] remi@php.net
Closing, as indeed fixed in PHP-7.2 branch
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC