From 2753f285bc7af6222f1a131f114edede574d53df Mon Sep 17 00:00:00 2001 From: "X14XA\\shengli" Date: Tue, 6 Jan 2026 13:40:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DsetAccessible=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E6=94=AF=E6=8C=81PHP8.5.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/concerns/ModifyProperty.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/concerns/ModifyProperty.php b/src/concerns/ModifyProperty.php index cf75d03..83d9a4e 100644 --- a/src/concerns/ModifyProperty.php +++ b/src/concerns/ModifyProperty.php @@ -11,7 +11,9 @@ trait ModifyProperty $reflectObject = new ReflectionObject($object); if ($reflectObject->hasProperty($property)) { $reflectProperty = $reflectObject->getProperty($property); - $reflectProperty->setAccessible(true); + if(PHP_VERSION_ID < 80100) { + $reflectProperty->setAccessible(true); + } $reflectProperty->setValue($object, $value); } }