php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7657 $argc / $argv no longer working in command line scripting
Submitted: 2000-11-06 03:49 UTC Modified: 2000-11-06 05:00 UTC
From: hartmut at six dot de Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Latest CVS (06/11/2000) OS: *nix
Private report: No CVE-ID: None
 [2000-11-06 03:49 UTC] hartmut at six dot de
when using the cgi version of php as a command line script processor
it does no longer transfer command line arguments into the $argv array

the following script argv.php

  <?php
    var_dump($argc);
    var_dump($argv);
  ?>

when called as 

  php -q argv.php abc def

should return (and does so up to PHP 4.0.3pl1)

  int(3)
  array(3) {
    [0]=>
    string(8) "argv.php"
    [1]=>
    string(3) "abc"
    [2]=>
    string(3) "def"
  }

recent CVS versions of php 4.0.4dev return

  int(0)
  array(0) {
  }

instead ...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-06 05:00 UTC] stas@php.net
Fixed in CVS
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Jan 17 21:01:24 2020 UTC