PHP 4.0 Bug #7960: fopen or fclose troubles with 'php://stdin'

From: Date: Fri, 24 Nov 2000 09:57:04 +0000
Subject: PHP 4.0 Bug #7960: fopen or fclose troubles with 'php://stdin'
Groups: php.dev 
Request: Send a blank email to php-dev+get-39088@lists.php.net to get a copy of this message
From: p.pastori@acsys.it Operating system: WIN32, WINNT, IRIX PHP version: 4.0.3pl1 PHP Bug Type: Filesystem function related Bug description: fopen or fclose troubles with 'php://stdin' <?php /* fopen bug ??? */ function ask($prompt = '', $mxin = 256) { $ret = false; print($prompt); $ifd = fopen('php://stdin', 'r'); if ($ifd) { $ret = fgets($ifd, $mxin); if (! fclose($ifd)) print("FCLOSE FAILED\r\n"); } return $ret; } if ($rep = ask()) print($rep); /* * next ask call causes under WIN32 WIN98 Second Edition: *[23-Nov-2000 22:51:02] PHP Warning: fopen("php://stdin","r") - No error in fopenbug.php on line 6 * under IRIX 6.5 (6.5.8m): *[24-Nov-2000 10:35:21] PHP Warning: fopen("php://stdin","r") - Bad file number in fopenbug.php on line 6 * and under WINNT 4.0 Service Pack 6: *[24-Nov-2000 10:49:34] PHP Warning: fopen("php://stdin","r") - No error in fopenbug.php on line 6 */ if ($rep = ask()) print($rep); ?> -- Edit Bug report at: http://bugs.php.net/?id=7960&edit=1

« previous php.dev (#39088) next »