php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17053 argc,argv not defined when running php -q
Submitted: 2002-05-06 18:40 UTC Modified: 2002-05-07 03:30 UTC
From: gribnaw at hotmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.2.0 OS: Windows
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: gribnaw at hotmail dot com
New email:
PHP Version: OS:

 

 [2002-05-06 18:40 UTC] gribnaw at hotmail dot com
On clean install of Windows binary 4.2.0 installer:

While running php -q on windows release 4.2.0, argc and argv are not defined. The following script reproduces the error message:

<?php 
print $argc; 
?>

This worked in 4.0.6.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-06 18:55 UTC] alan_k@php.net
In PHP 4.2.0, the 'register_globals' setting default changed to
be off. See http://www.php.net/release_4_2_0.php for more info.
 [2002-05-07 03:30 UTC] sander@php.net
That's not the problem. 
The problem is you're using the CGI-binary and you should use the CLI-binary (php-cli.exe).
$argc and $argv will be registered regardless of the register_globals setting.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Dec 02 08:00:01 2025 UTC