thought stdin was supposed to default open

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hello,
I read that in the cli version of php, the 3 files, sterror, stdout and stdin are already open thus saving having to open them and close them each time. Well, I decided to test that idea and it appears that stdin infact is not pre-opened, but my code may be wrong too, who knows. I made a little test script (see below), but either it ends up outputting nothing, or i get the "... assumed 'STDIN'" and "supplied argument is not a valid resource...." but on the same line.
anyway, code is below

<?php
while(STDIN != '\n');
{
$line = fgets(STDIN);
echo $line;
}
?>

simple script, but it appears not to work. is it my code, or is STDIN not opened by default in php4.4
this is on slackware linux version 10.2 running php -v 4.4
matt

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux