-
Bug
-
Resolution: Fixed
-
Minor
-
4.2
-
MOODLE_402_STABLE
-
MOODLE_402_STABLE
-
MDL-76415-master -
-
2
-
Team Hedgehog Sprint 1 review, Team Hedgehog Sprint 2.1
Supported string interpolations:
$name = 'PHP';
|
echo "Hello $name"; // Hello PHP
|
echo "Hello {$name}"; // Hello PHP
|
The following will no longer be supported:
$name = 'PHP';
|
$var = 'name';
|
echo "Hello ${name}"; // Dollar outside of curly braces deprecated
|
echo "Hello $$var"; // Variable variables deprecated
|
echo "Hello ${$var}"; // Variable variables deprecated
|
echo "Hello $$object->getMethod()"; // Variable expressions deprecated
|
The following can be used instead:
echo "Hello {$name}"; // Dollar moved inside the braces
|
echo "Hello {$$var}"; // Variable variables can be used inside braces
|
echo "Hello {${$object->getMethod()}}"; // Variable expressions can be used inside braces
|
https://php.watch/versions/8.2/$%7Bvar%7D-string-interpolation-deprecated
Note: This is the opposite of JavaScript.
- has been marked as being related by
-
MDL-78252 Upgrade PHP-ML to 0.10.0
- Closed