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:
@@ -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();
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user