|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2001-10-19 08:01 UTC] sander@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 21:00:02 2025 UTC | 
<?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); ?>