Skip to content

Commit

Permalink
[fix] using ${var} in strings is deprecated
Browse files Browse the repository at this point in the history
Using ${var} in strings is deprecated with php 8.2
  • Loading branch information
etrappg authored and Enzo Trapp Galbardi committed Jan 5, 2023
1 parent 74be58f commit 1fb670c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Medoo.php
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ function ($matches) {
public function quote(string $string): string
{
if ($this->type === 'mysql') {
return "'" . preg_replace(['/([\'"])/', '/(\\\\\\\")/'], ["\\\\\${1}", '\\\${1}'], $string) . "'";
return "'" . preg_replace(['/([\'"])/', '/(\\\\\\\")/'], ["\\\\\{$1}", '\\\{$1}'], $string) . "'";
}
return "'" . preg_replace('/\'/', '\'\'', $string) . "'";
Expand Down Expand Up @@ -867,7 +867,7 @@ protected function dataImplode(array $data, array &$map, string $conjunctor): st
$operator = $match['operator'] ?? null;

if ($isIndex && isset($match[4]) && in_array($operator, ['>', '>=', '<', '<=', '=', '!='])) {
$stack[] = "${column} ${operator} " . $this->columnQuote($match[4]);
$stack[] = "{$column} {$operator} " . $this->columnQuote($match[4]);
continue;
}

Expand Down

0 comments on commit 1fb670c

Please sign in to comment.