From: [EMAIL PROTECTED]
Operating system: Any
PHP version: 4.0.6
PHP Bug Type: Feature/Change Request
Bug description: Scripting language features
I use PHP as a general scripting language, and some compile or runtime options would
be very useful:
- A no-tags mode that would have the interpreter behave as if it were always inside a
<?php ?> block
- Standard file handles predefined, similiar to $argc and $argv[]: $stdin, $stdout,
$stderr
- Quiet mode always enabled
The following script is too complicated:
#!/usr/local/bin/php -q
<?
$l = "";
$fp = fopen("php://stdin", "r");
while (!feof($fp))
{
$s = fgets($fp, 5000);
if ($l != $s)
{
echo $s;
$l = $s;
}
}
?>
It would be much nicer to write it as follows:
#!/usr/local/bin/php
$l = "";
while (!feof($stdin))
{
$s = fgets($stdin, 5000);
if ($l != $s)
{
echo $s;
$l = $s;
}
}
--
Edit Bug report at: http://bugs.php.net/?id=11944&edit=1
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]