Bug #11944 Updated: Scripting language features
| From: | jimw@php.net | Date: | Sat, 27 Apr 2002 19:40:44 +0000 |
| Subject: | Bug #11944 Updated: Scripting language features | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-6290@lists.php.net to get a copy of this message | ||
ID: 11944
Updated by: jimw@php.net
Reported By: dphillips@vsni.com
-Status: Open
+Status: Closed
Bug Type: Feature/Change Request
Operating System: Any
PHP Version: 4.0.6
New Comment:
the cli version of php does most of this.
Previous Comments:
------------------------------------------------------------------------
[2001-07-07 00:21:30] dphillips@vsni.com
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 this bug report at http://bugs.php.net/?id=11944&edit=1