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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: hartmut at six dot de
New email:
PHP Version: OS:

 

 [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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-06 05:00 UTC] stas@php.net
Fixed in CVS
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 09:01:34 2025 UTC