3 ms·
Even worse, it will reveal the variables used by your page to the user, which in some cases can be a security risk. I assume it will raise a syntax error, as t
by sam_goody 4y ago
Even worse, it will reveal the variables used by your page to the user, which in some cases can be a security risk.
I assume it will raise a syntax error, as the PHP team is good about these things.
- tuxone 4y agoA syntax error would be \s fun though, would you have to escape the sequence in order to get that intentionally?
- iforgotpassword 4y agoBut that's also stupid because you cannot actually simplify the parser that much then, as you still need to detect it. And then you could just keep supporting it anyways, since it pretty much calls into the same code as the surrounding curly braces after that.
- mtrpcic 4y agoI mean, you could just set the parser to throw an exception if it ever detects anything other than a character (a-zA-Z) after an un-escaped dollar sign. Then you can just throw the same error, "Invalid string interpolation" so that no internal state of your program leaks, and you can immediately skip any subsequent memory reads for the contents of the variable.
- innocenat 4y agoIf you have display_errors on, you have much security risk than this.