svn: /phpdoc/en/trunk/features/ commandline.xml

From: Date: Mon, 29 Nov 2010 17:04:30 +0000
Subject: svn: /phpdoc/en/trunk/features/ commandline.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-7480@lists.php.net to get a copy of this message
danbrown Mon, 29 Nov 2010 17:04:30 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=305839 Log: Rewrite of $argv blurb, which not only contained a typo, but was rather confusing in its present form. Changed paths: U phpdoc/en/trunk/features/commandline.xml Modified: phpdoc/en/trunk/features/commandline.xml =================================================================== --- phpdoc/en/trunk/features/commandline.xml 2010-11-29 15:50:21 UTC (rev 305838) +++ phpdoc/en/trunk/features/commandline.xml 2010-11-29 17:04:30 UTC (rev 305839) @@ -1075,9 +1075,14 @@ 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 <varname>$argv</varname>. The zero index always contains the - script name (which is <literal>-</literal> in case the PHP codeis coming from - either standard input or from the command line switch <option>-r</option>). + global array <varname>$argv</varname>. 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 <option>-r</option>, the value of + <varname>$argv[0]</varname> will be simply a dash (<literal>-</literal>). The + same is true if the code is executed via a pipe from <literal>STDIN</literal>. + </para> + + <para> The second registered global variable is <varname>$argc</varname> which contains the number of elements in the <varname>$argv</varname> array (<emphasis role="strong">not</emphasis> the number of arguments passed to the

« previous php.doc.cvs (#7480) next »