Strange fopen behavior
| From: | Darrell Brogdon | Date: | Fri, 14 Jul 2000 20:25:01 +0000 |
| Subject: | Strange fopen behavior | ||
| Groups: | php.dev php.general | ||
| Request: | Send a blank email to php-dev+get-24559@lists.php.net to get a copy of this message | ||
I have the following code:
<?php
function read()
{
$fp = fopen("/dev/stdin", "r");
$input = fread($fp, 255);
fclose($fp);
return str_replace("\n", "", $input);
}
print("What is your name? ");
$name = read();
print("Hello $name.");
?>
which used to work just fine. Now, with PHP 4.0.1pl2, it requires a
CTRL+D before it will execute the first 'print()' statement.
Has something changed about fopen since version 4.0 beta?