1--TEST-- 2Bug #72853 (stream_set_blocking doesn't work) 3--SKIPIF-- 4<?php 5if(substr(PHP_OS, 0, 3) == 'WIN' ) { 6 die('skip not for windows'); 7} 8?> 9--FILE-- 10<?php 11 12$descs = array( 13 0 => array('pipe', 'r'), // stdin 14 1 => array('pipe', 'w'), // stdout 15); 16 17$p = proc_open("ls", $descs, $pipes, '.', NULL, NULL); 18 19stream_set_blocking($pipes[1], false); 20var_dump(stream_get_meta_data($pipes[1])); 21stream_set_blocking($pipes[1], true); 22while ($outs = fgets($pipes[1], 1024)) { 23} 24var_dump(stream_get_meta_data($pipes[1])); 25proc_close($p); 26?> 27--EXPECTF-- 28array(7) { 29 ["timed_out"]=> 30 bool(false) 31 ["blocked"]=> 32 bool(false) 33 ["eof"]=> 34 bool(false) 35 ["stream_type"]=> 36 string(5) "STDIO" 37 ["mode"]=> 38 string(1) "r" 39 ["unread_bytes"]=> 40 int(0) 41 ["seekable"]=> 42 bool(false) 43} 44array(7) { 45 ["timed_out"]=> 46 bool(false) 47 ["blocked"]=> 48 bool(true) 49 ["eof"]=> 50 bool(true) 51 ["stream_type"]=> 52 string(5) "STDIO" 53 ["mode"]=> 54 string(1) "r" 55 ["unread_bytes"]=> 56 int(0) 57 ["seekable"]=> 58 bool(false) 59} 60