1--TEST-- 2std handles can be deliberately closed 001 3--SKIPIF-- 4<?php 5if (php_sapi_name() != "cli") { 6 die("skip CLI only"); 7} 8if (PHP_OS_FAMILY == 'Windows') { 9 die("skip not for Windows"); 10} 11?> 12--FILE-- 13<?php 14print "STDIN:\n"; 15fclose(STDIN); 16var_dump(@fopen('php://stdin', 'r')); 17 18print "STDERR:\n"; 19fclose(STDERR); 20var_dump(@fopen('php://stderr', 'a')); 21 22print "STDOUT:\n"; 23fclose(STDOUT); 24// not printed if stdout is closed 25var_dump(@fopen('php://stdout', 'a')); 26?> 27--EXPECT-- 28STDIN: 29bool(false) 30STDERR: 31bool(false) 32STDOUT: 33