Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions features/commandline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -533,19 +533,28 @@ string(15) "doesntmakesense"
<entry>--syntax-check</entry>
<entry>
<para>
Provides a convenient way to perform only a syntax check
on the given PHP code. On success, the text
Syntax check but do not execute the given PHP code.
The input from standard input will be processed if no filenames are specified,
otherwise each filename will be checked.
On success, the text
<literal>No syntax errors detected in &lt;filename&gt;</literal> is
written to standard output and the shell return code is
<literal>0</literal>. On failure, the text <literal>Errors parsing
&lt;filename&gt;</literal> in addition to the internal parser error
message is written to standard output and the shell return code is set
to <literal>-1</literal>.
written to standard output.
On failure, the text <literal>Errors parsing &lt;filename&gt;</literal>
is written to standard output in addition to the internal parser error.
If any failures are found in the specified files (or standard input),
the shell return code is set to <literal>-1</literal>, otherwise the
shell return code is set to <literal>0</literal>.
</para>
<para>
This option won't find fatal errors (like undefined functions). Use
the <option>-f</option> to test for fatal errors too.
This option won't find fatal errors (like undefined functions) that
require executing the code.
</para>
<note>
<para>
Prior to PHP 8.3.0, it was only possible to specify one filename to
be checked.
</para>
</note>
<note>
<para>
This option does not work together with the <option>-r</option>
Expand Down