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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 12 18:01:26 2024 UTC