[doc-en] master: Control structures/alternative syntax: mention `declare` (#5859)

From: Date: Tue, 15 Sep 2026 08:20:51 +0000
Subject: [doc-en] master: Control structures/alternative syntax: mention `declare` (#5859)
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-23754@lists.php.net to get a copy of this message
Author: Juliette (jrfnl) Committer: GitHub (web-flow) Pusher: lacatoire Date: 2026-09-15T10:20:47+02:00 Commit: https://github.com/php/doc-en/commit/72ea6871bb7b005110e6cbc42f17970c5a985826 Raw diff: https://github.com/php/doc-en/commit/72ea6871bb7b005110e6cbc42f17970c5a985826.diff Control structures/alternative syntax: mention declare (#5859) While not mentioned anywhere, the declare() control structure also allows for the alternative syntax. This may typically be used for a ticks declare using block mode. Co-authored-by: jrfnl <jrfnl@users.noreply.github.com> Changed paths: M language/control-structures/alternative-syntax.xml Diff: diff --git a/language/control-structures/alternative-syntax.xml b/language/control-structures/alternative-syntax.xml index 0ab3e5d9fddd..18435c856e87 100644 --- a/language/control-structures/alternative-syntax.xml +++ b/language/control-structures/alternative-syntax.xml @@ -8,12 +8,14 @@ PHP offers an alternative syntax for some of its control structures; namely, <literal>if</literal>, <literal>while</literal>, <literal>for</literal>, - <literal>foreach</literal>, and <literal>switch</literal>. + <literal>foreach</literal>, <literal>switch</literal>, + and <literal>declare</literal>. In each case, the basic form of the alternate syntax is to change the opening brace to a colon (:) and the closing brace to <literal>endif;</literal>, <literal>endwhile;</literal>, - <literal>endfor;</literal>, <literal>endforeach;</literal>, or - <literal>endswitch;</literal>, respectively. + <literal>endfor;</literal>, <literal>endforeach;</literal>, + <literal>endswitch;</literal>, or <literal>enddeclare;</literal>, + respectively. <informalexample> <programlisting role="php"> <![CDATA[

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