diff --git a/features/commandline.xml b/features/commandline.xml index 575ec5de23..9d08c6c61f 100644 --- a/features/commandline.xml +++ b/features/commandline.xml @@ -1075,9 +1075,14 @@ $ some_application | some_filter | php | sort -u > final_output.txt can be passed to your script is not limited by PHP (the shell has a certain size limit in the number of characters which can be passed; usually you won't hit this limit). The arguments passed to your script are available in the - global array $argv. The zero index always contains the - script name (which is - in case the PHP codeis coming from - either standard input or from the command line switch ). + global array $argv. The first index (zero) always contains the + name of the script as called from the command line. Note that, if the code is + executed in-line using the command line switch , the value of + $argv[0] will be simply a dash (-). The + same is true if the code is executed via a pipe from STDIN. + + + The second registered global variable is $argc which contains the number of elements in the $argv array (not the number of arguments passed to the