php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #11944 Scripting language features
Submitted: 2001-07-07 00:21 UTC Modified: 2002-04-27 15:40 UTC
From: dphillips at vsni dot com Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.6 OS: Any
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dphillips at vsni dot com
New email:
PHP Version: OS:

 

 [2001-07-07 00:21 UTC] dphillips at vsni dot 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;
    }
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-27 15:40 UTC] jimw@php.net
the cli version of php does most of this.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 08:01:27 2025 UTC