From 07b530aa58a4eee5f57cdabcdee0eae099f0541e Mon Sep 17 00:00:00 2001 From: Philip Olson Date: Thu, 14 Nov 2002 11:22:58 +0000 Subject: [PATCH] $argv and $argc only exist if register_globals = on in CLI before 4.3.0 Closes bug #20411 git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@103835 c90b9560-bf6c-de11-be94-00142212c4b1 --- features/commandline.xml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/features/commandline.xml b/features/commandline.xml index 824d3083b1..53712792dc 100644 --- a/features/commandline.xml +++ b/features/commandline.xml @@ -1,5 +1,5 @@ - + Using PHP from the command line @@ -99,11 +99,26 @@ register_argc_argv &true; - The global PHP variables $argc - (number of arguments passed to the application) and - $argv (array of the actual arguments) are always - registered and filled in with the appropriate values when using the - CLI SAPI. + + Because this setting is &true; you will always have access to + argc (number of arguments passed to the + application) and argv (array of the actual + arguments) in the CLI SAPI. + + + As of PHP 4.3.0, the PHP variables $argc + and $argv are registered and filled in with the appropriate + values when using the CLI SAPI. Before this time + the creation of these variables behaved as they do in + CGI and MODULE versions + which requires the PHP directive + register_globals to + be on. Regardless of version or register_globals + setting you can always go through either + $_SERVER or + $HTTP_SERVER_VARS. Example: + $_SERVER['argv'] +