bindings; $rawSql = preg_replace_callback('/\?/', function ($matches) use ($bindings, &$i) { $item = isset($bindings[$i]) ? $bindings[$i] : $matches[0]; $i++; return gettype($item) == 'string' ? "'$item'" : $item; }, $sql->sql); //记录sql LoggerFactoryUtil::addSqlMessage($rawSql); // echo $rawSql, "\n

\n"; }); } }