Skip to content

Commit

Permalink
Rewrite and flesh out string interpolation docs (#2000)
Browse files Browse the repository at this point in the history
* Rewrite and flesh out string interpolation docs

This covers the PHP 8.2.0 deprecation of interpolation
It also renames simple to basic and complex to advanced, as those don't make a judgement on complexity

* Remove variable variable examples, add more examples, review comments

* Change ID for basic/advanced string interpolation

* Define the formal syntax and remove clunky wording

* Re-add example for bug 81635 fix
  • Loading branch information
Girgias authored Oct 2, 2024
1 parent 8363ee9 commit b012e0d
Show file tree
Hide file tree
Showing 2 changed files with 181 additions and 156 deletions.
18 changes: 12 additions & 6 deletions appendices/tokens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,10 @@ defined('T_FN') || define('T_FN', 10001);
<row xml:id="constant.t-curly-open">
<entry><constant>T_CURLY_OPEN</constant></entry>
<entry>{$</entry>
<entry><link linkend="language.types.string.parsing.complex">complex
variable parsed syntax</link></entry>
<entry>
<link linkend="language.types.string.parsing.advanced">advanced</link>
variable string interpolation
</entry>
</row>
<row xml:id="constant.t-dec">
<entry><constant>T_DEC</constant></entry>
Expand Down Expand Up @@ -255,8 +257,10 @@ defined('T_FN') || define('T_FN', 10001);
<row xml:id="constant.t-dollar-open-curly-braces">
<entry><constant>T_DOLLAR_OPEN_CURLY_BRACES</constant></entry>
<entry>${</entry>
<entry><link linkend="language.types.string.parsing.complex">complex
variable parsed syntax</link></entry>
<entry>
<link linkend="language.types.string.parsing.basic">basic</link>
variable string interpolation
</entry>
</row>
<row xml:id="constant.t-double-arrow">
<entry><constant>T_DOUBLE_ARROW</constant></entry>
Expand Down Expand Up @@ -799,8 +803,10 @@ defined('T_FN') || define('T_FN', 10001);
<row xml:id="constant.t-string-varname">
<entry><constant>T_STRING_VARNAME</constant></entry>
<entry>"${a</entry>
<entry><link linkend="language.types.string.parsing.complex">complex
variable parsed syntax</link></entry>
<entry>
<link linkend="language.variables.variable">variable variables</link>
to interpolate in a string
</entry>
</row>
<row xml:id="constant.t-switch">
<entry><constant>T_SWITCH</constant></entry>
Expand Down
Loading

0 comments on commit b012e0d

Please sign in to comment.