PHP variable parsing

More a curiosity than a real issue but I would still be quite happy to learn the logic behind it.
Parsing variables with ${variable_name} leaves the text in the exercise the same color as the remainder of the string, but when written as follows {$variable_name} then it marks the variable as a separate part of the string (changes color).
Important to say is that both ways give the same exact output.
What I am wondering is this just a fluke in the Codecademy terminal or is there a deeper reason for that?

https://www.codecademy.com/courses/learn-php/lessons/php-strings-and-variables/exercises/variable-parsing

Hello @chip3853589309, welcome to the forums! Iā€™m pretty sure this is just a fluke, because if you type it in another editor, then they both appear the same colour:

Thanks, good to know :slight_smile:

1 Like