Skip to content

Commit f9b720b

Browse files
authored
Correct PHP string interpolation syntax
The examples provided had incorrectly merged Scala and PHP. Scala's string interpolation is written `s"$foo"` whereas PHP is written `"$foo"`
1 parent 46efff3 commit f9b720b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

text/0000-format-args-implicit-identifiers.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,11 @@ The following code would be the equivalent way to produce a new string combining
255255
// Ruby
256256
"#{greeting} #{person}"
257257

258-
// Scala / PHP
258+
// Scala
259259
s"$greeting $person"
260+
261+
// PHP
262+
"$greeting $person"
260263

261264
It is the RFC author's experience that these interpolating mechanisms read easily from left-to-right and it is clear where each variable is being substituted into the format string.
262265

0 commit comments

Comments
 (0)