Skip to content

Commit cb61026

Browse files
committed
改进__unserialize方法
1 parent 0140fb6 commit cb61026

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Model.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,10 @@ public function __serialize(): array
827827
*/
828828
public function __unserialize(array $data)
829829
{
830+
if (!self::$weakMap) {
831+
self::$weakMap = new WeakMap;
832+
}
833+
830834
self::$weakMap[$this] = $data;
831835
// 重新初始化
832836
$this->initialize();

0 commit comments

Comments
 (0)