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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
7 + 30 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 09:01:27 2024 UTC