php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60309 fread(STDIN, 1024) returns instantly.
Submitted: 2011-11-15 19:56 UTC Modified: 2011-11-18 02:29 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: Dygear at gmail dot com Assigned: laruence (profile)
Status: Closed Package: Streams related
PHP Version: 5.4.0RC1 OS: Windows 7 - CLI
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: Dygear at gmail dot com
New email:
PHP Version: OS:

 

 [2011-11-15 19:56 UTC] Dygear at gmail dot com
Description:
------------
I am using the windows version of PHP 5.4 (5.4.0RC1) from 2011-Nov-10 19:52:12, 
VC9 x86 Non Thread Safe. In 5.3.x the code worked to where I could query a client 
for an input from the command line using fread and STDIN. In the version stated, 
5.4.0RC1, the function returns right away, and does not give the user anytime to 
input a string.

Test script:
---------------
<?php

	# stream_set_blocking(STDIN, TRUE); // Has no effect.

	echo fread(STDIN, 1024);

?>

Expected result:
----------------
I would expect for there be an opportunity for the user to input a string.

Actual result:
--------------
The script has no result, and the client is never queried for a string.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-16 07:41 UTC] laruence@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.4-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

I can't reproduce this in my environ. 
but I do fine that 
stream_set_blocking(STDIN, FALSE);  Has no effect on windows
 [2011-11-16 07:41 UTC] laruence@php.net
-Status: Open +Status: Feedback
 [2011-11-17 13:19 UTC] Dygear at gmail dot com
It seem that the snapshot was never compiled for the windows side, all 5.4 branch 
downloads on the http://windows.php.net/snapshots/ are 0 Bytes, and just redirect 
in a loop.
 [2011-11-17 13:27 UTC] Dygear at gmail dot com
Never mind, I now realize that the link was at the bottom. So I downloaded 
http://windows.php.net/downloads/snaps/php-trunk/r319151/php-trunk-nts-windows-
vc9-x86-r319151.zip and now it works! Great job if that build includes your fix!
 [2011-11-17 15:27 UTC] pajoye@php.net
next should work again.
 [2011-11-18 02:29 UTC] laruence@php.net
I this this could be closed now
 [2011-11-18 02:29 UTC] laruence@php.net
-Status: Feedback +Status: Closed -Assigned To: +Assigned To: laruence
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 03:01:28 2024 UTC