|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-07-31 15:27 UTC] laruence@php.net
[2012-07-31 15:27 UTC] laruence@php.net
-Status: Open
+Status: Feedback
[2012-07-31 16:47 UTC] brandon dot landry at dvusd dot org
[2012-07-31 17:39 UTC] brandon dot landry at dvusd dot org
[2012-09-01 22:27 UTC] cataphract@php.net
[2012-09-01 22:27 UTC] cataphract@php.net
-Status: Feedback
+Status: Open
-Type: Bug
+Type: Documentation Problem
[2012-09-04 20:14 UTC] brandon dot landry at dvusd dot org
[2025-01-18 19:50 UTC] bukka@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: bukka
[2025-01-18 19:50 UTC] bukka@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 06:00:02 2025 UTC |
Description: ------------ In php 5.3.11 there was some change made to stream_get_line which causes this test script to hang (it still hangs on the latest version from 5.3 and 5.4 branches). In the changelog for that version it says stream_get_line was changed to be more in line with fgets ... Now if you replace stream_get_line with fgets the script does run seemingly correctly ... The only reason I am reporting this is, if the function was changed to be more in line with fgets, and fgets works but stream_get_line does not, ... is this a bug or something I am missing. Test script: --------------- <?php $descSpec = array( array('pipe','r'), // stdin array('pipe','w'), // stdout array('pipe','w') // stderr ); $proc = proc_open('bash', $descSpec, $pipes,'/tmp',array()); if(!is_resource($proc)){ throw new Exception("Could not open bash process"); } $stdin = &$pipes[0]; $stdout = &$pipes[1]; $stderr = &$pipes[2]; stream_set_blocking($stdout,0); stream_set_blocking($stderr,0); fwrite($stdin, "pwd\n"); fflush($stdin); $write = null; $except = null; $stdoutArr = array($stdout); $rv = stream_select($stdoutArr,$write,$except,1); $strIn = stream_get_line($stdout,4096); var_export(array('streamSelect_returnVal'=>$rv,'stdout_strRead'=>$strIn));