-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed as not planned
Labels
Description
Description
Within a Heredoc statement, the parser correctly escapes the \${url}
used in the Template literal, treating it a string
, but incorrectly, IMHO, emits a Warning:
Deprecated: Using ${var} in strings is deprecated, use {$var} instead.
The following code:
<?php
$script = <<<HTML
<script>
window.addEventListener("message", getFrames, false);
function getFrames (e) {
if (e.data.hasOwnProperty("url")) {
let url = e.data.url.toString();
let myFrame = document.querySelector(`iframe[src^='\${url}']`);
...
The actual output is correct
But I expected no Warning since I'm not using ${url}
but \${url}
PHP Version
PHP 8.2.20
Operating System
No response