From 9758d250fb5ceb8f76da0fc001309710eda5d396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=82=B2=E4=B8=96?= <50762123+Rodots@users.noreply.github.com> Date: Fri, 2 Dec 2022 22:39:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9PHP=208.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在PHP 8.2中 ${var} 字符串插入变量解析语法已被弃用,应将$放在花括号里面,否则将会抛出异常无法正常使用 --- src/XdbSearcher.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/XdbSearcher.php b/src/XdbSearcher.php index 1308b58..bb240ce 100644 --- a/src/XdbSearcher.php +++ b/src/XdbSearcher.php @@ -129,7 +129,7 @@ class XdbSearcher // read the vector index block $buff = $this->read(self::HeaderInfoLength + $idx, 8); if ($buff === null) { - throw new \Exception("failed to read vector index at ${idx}"); + throw new \Exception("failed to read vector index at {$idx}"); } $sPtr = self::getLong($buff, 0); @@ -150,7 +150,7 @@ class XdbSearcher // read the segment index $buff = $this->read($p, self::SegmentIndexSize); if ($buff == null) { - throw new \Exception("failed to read segment index at ${p}"); + throw new \Exception("failed to read segment index at {$p}"); } $sip = self::getLong($buff, 0); @@ -268,11 +268,11 @@ class XdbSearcher // return the decoded header info return [ - 'version' => self::getShort($buff, 0), - 'indexPolicy' => self::getShort($buff, 2), - 'createdAt' => self::getLong($buff, 4), + 'version' => self::getShort($buff, 0), + 'indexPolicy' => self::getShort($buff, 2), + 'createdAt' => self::getLong($buff, 4), 'startIndexPtr' => self::getLong($buff, 8), - 'endIndexPtr' => self::getLong($buff, 12) + 'endIndexPtr' => self::getLong($buff, 12) ]; }