Skip to content

Commit 7358dcc

Browse files
change comparing by serialization to different comparing type (related to variable type)
1 parent 13d48d4 commit 7358dcc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Eloquent/DocumentModel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040
use function in_array;
4141
use function is_array;
4242
use function is_numeric;
43+
use function is_object;
4344
use function is_string;
4445
use function ltrim;
4546
use function method_exists;
46-
use function serialize;
4747
use function sprintf;
4848
use function str_contains;
4949
use function str_starts_with;
@@ -379,7 +379,7 @@ public function originalIsEquivalent($key)
379379
}
380380

381381
if ($this->isClassCastable($key)) {
382-
return serialize($attribute) === serialize($original);
382+
return ! is_object($attribute) ? $attribute === $original : $attribute == $original;
383383
}
384384

385385
return is_numeric($attribute) && is_numeric($original)

0 commit comments

Comments
 (0)