features/commandline.xml
d4d5216e7a965ca194f6b1c9dee84cecab2674e5
...
...
@@ -506,13 +506,6 @@ string(15) "doesntmakesense"
506
506
<option>-f</option> is optional and may be omitted - providing just
507
507
the filename to execute is sufficient.
508
508
</para>
509
-
<note>
510
-
<para>
511
-
To pass arguments to a script, the first argument must be
512
-
<literal>--</literal>, otherwise PHP will interpret them as PHP
513
-
options.
514
-
</para>
515
-
</note>
516
509
</entry>
517
510
</row>
518
511
<row>
...
...
@@ -1046,12 +1039,6 @@ $ php -f my_script.php
1046
1039
restriction on which files can be executed; in particular, the filename
1047
1040
is not required have a <literal>.php</literal> extension.
1048
1041
</para>
1049
-
<note>
1050
-
<para>
1051
-
If arguments need to be passed to the script when using
1052
-
<option>-f</option>, the first argument must be <literal>--</literal>.
1053
-
</para>
1054
-
</note>
1055
1042
</listitem>
1056
1043
<listitem>
1057
1044
<para>
...
...
@@ -1107,7 +1094,7 @@ $ some_application | some_filter | php | sort -u > final_output.txt
1107
1094
first index (zero) always contains the name of the script as called from the
1108
1095
command line. Note that, if the code is executed in-line using the command
1109
1096
line switch <option>-r</option>, the value of <varname>$argv[0]</varname>
1110
-
will be just a dash (<literal>-</literal>). The same is true if the code is
1097
+
will be <literal>"Standard input code"</literal>; prior to PHP 7.2.0, it was a dash (<literal>"-"</literal>) instead. The same is true if the code is
1111
1098
executed via a pipe from <literal>STDIN</literal>.
1112
1099
</para>
1113
1100

...
...
@@ -1264,7 +1251,7 @@ This is a command line PHP script with one option.
1264
1251
<para>
1265
1252
<example>
1266
1253
<title>Batch file to run a command line PHP script (script.bat)</title>
1267
-
<programlisting role="shell">
1254
+
<programlisting role="winbat">
1268
1255
<![CDATA[
1269
1256
@echo OFF
1270
1257
"C:\php\php.exe" script.php %*
...
...
@@ -1289,7 +1276,7 @@ This is a command line PHP script with one option.
1289
1276
<para>
1290
1277
On Windows, PHP can be configured to run without the need to
1291
1278
supply the <filename>C:\php\php.exe</filename> or the <literal>.php</literal>
1292
-
extension, as described in <link linkend="install.windows.legacy.commandline">Command
1279
+
extension, as described in <link linkend="install.windows.commandline">Command
1293
1280
Line PHP on Microsoft Windows</link>.
1294
1281
</para>
1295
1282

...
...
@@ -1594,6 +1581,23 @@ php >
1594
1581
defined before called.
1595
1582
</para>
1596
1583
</note>
1584
+

1585
+
<section xml:id="features.commandline.interactive.mode">
1586
+
<title>Interactive mode</title>
1587
+
<para>
1588
+
If the readline extension is not available, prior to PHP 8.1.0, invoking the &cli.sapi; with the
1589
+
<option>-a</option> option provided the interactive mode. In this mode, a
1590
+
complete PHP script is supposed to be given via STDIN, and after termination
1591
+
with <literal>CRTL+d</literal> (POSIX) or <literal>CTRL+z</literal>
1592
+
followed by <literal>ENTER</literal> (Windows), this script is evaluated.
1593
+
This is basically the same as invoking the &cli.sapi; without the <option>-a</option>
1594
+
option.
1595
+
</para>
1596
+
<para>
1597
+
As of PHP 8.1.0, invoking the &cli.sapi; with the <option>-a</option> option
1598
+
fails, if the readline extension is not available.
1599
+
</para>
1600
+
</section>
1597
1601
</section>
1598
1602
<!--}}}-->
1599
1603

...
...
@@ -1903,7 +1907,7 @@ $ php -S 0.0.0.0:8000
1903
1907
<row>
1904
1908
<entry><link linkend="ini.cli-server.color">cli_server.color</link></entry>
1905
1909
<entry>"0"</entry>
1906
-
<entry>PHP_INI_ALL</entry>
1910
+
<entry><constant>INI_ALL</constant></entry>
1907
1911
<entry></entry>
1908
1912
</row>
1909
1913
</tbody>
1910
1914