1
0
mirror of https://github.com/php/doc-en.git synced 2026-03-23 23:32:18 +01:00

Replace deprecated ${var} string interpolations with {$var} (#3179)

This commit is contained in:
Takuya Aramaki
2024-02-14 02:04:06 +09:00
committed by GitHub
parent 768876982f
commit 9e6c3416c5
3 changed files with 4 additions and 4 deletions

View File

@@ -315,7 +315,7 @@ if (isset($_GET['width']) AND isset($_GET['height'])) {
// -- post variables will need to handled differently)
echo "<script language='javascript'>\n";
echo " location.href=\"${_SERVER['SCRIPT_NAME']}?${_SERVER['QUERY_STRING']}"
echo " location.href=\"{$_SERVER['SCRIPT_NAME']}?{$_SERVER['QUERY_STRING']}"
. "&width=\" + screen.width + \"&height=\" + screen.height;\n";
echo "</script>\n";
exit();

View File

@@ -108,7 +108,7 @@ array(4) {
<?php
$result = $collection->find()->execute();
foreach ($result as $doc) {
echo "${doc["name"]} is a ${doc["job"]}.\n";
echo "{$doc["name"]} is a {$doc["job"]}.\n";
}
?>
]]>

View File

@@ -101,10 +101,10 @@
// Using parameters. Note that it is not necessary to quote or escape
// the parameter.
pg_send_query_params($dbconn, 'select count(*) from authors where city = $1', array('Perth'));
// Compare against basic pg_send_query usage
$str = pg_escape_string('Perth');
pg_send_query($dbconn, "select count(*) from authors where city = '${str}'");
pg_send_query($dbconn, "select count(*) from authors where city = '{$str}'");
?>
]]>
</programlisting>