Skip to content

Commit

Permalink
Update string.xml to remove old string interpolation
Browse files Browse the repository at this point in the history
An example used the deprecated `${varname}` syntax; fix it.
  • Loading branch information
kohler authored Aug 26, 2023
1 parent 3d522c8 commit b031775
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions language/types/string.xml
Original file line number Diff line number Diff line change
Expand Up @@ -721,10 +721,10 @@ EOT;
$juice = "apple";
echo "He drank some $juice juice.".PHP_EOL;
// Invalid. "s" is a valid character for a variable name, but the variable is $juice.
// Unintended. "s" is a valid character for a variable name, so this refers to $juices, not $juice.
echo "He drank some juice made of $juices.";
// Valid. Explicitly specify the end of the variable name by enclosing it in braces:
echo "He drank some juice made of ${juice}s.";
// Explicitly specify the end of the variable name by enclosing the reference in braces.
echo "He drank some juice made of {$juice}s.";
?>
]]>
</programlisting>
Expand Down

0 comments on commit b031775

Please sign in to comment.