zlacker

[return to "PHP 8.2"]
1. Aachen+24[view] [source] 2022-12-08 12:53:44
>>TimWol+(OP)
Deprecated variables in strings? Or just when using the curly braces syntax for some reason? Unlike with every other entry there's no link but this sounds like the biggest change since PHP 4. Anyone know where to find more info?
◧◩
2. jorams+s4[view] [source] 2022-12-08 12:57:16
>>Aachen+24
PHP string interpolation has 3 possible syntaxes: $var, {$var} and ${var}. The last one is now deprecated. I've never seen it used in the wild, and it has some odd limitations. It's discussed in the RFC[1].

[1]: https://wiki.php.net/rfc/deprecate_dollar_brace_string_inter...

◧◩◪
3. tyingq+v5[view] [source] 2022-12-08 13:04:41
>>jorams+s4
>I've never seen it used in the wild

I imagine it might crop up for people that also use Perl, since that would be more common there, like:

$foo="abc${var}def";

◧◩◪◨
4. trey-j+T6[view] [source] 2022-12-08 13:13:59
>>tyingq+v5
bash also uses the same syntax, and I've probably used it before for that reason.
[go to top]