Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propose implicit named arguments for formatting macros #2795

Merged
Prev Previous commit
Next Next commit
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"`
  • Loading branch information
davidhewitt authored Oct 30, 2019
commit f9b720b37dda9d96e87c0640312263e1236903f7
5 changes: 4 additions & 1 deletion text/0000-format-args-implicit-identifiers.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 255,11 @@ The following code would be the equivalent way to produce a new string combining
// Ruby
"#{greeting} #{person}"

// Scala / PHP
// Scala
s"$greeting $person"

// PHP
davidhewitt marked this conversation as resolved.
Show resolved Hide resolved
"$greeting $person"

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.

Expand Down