Skip to content

Commit 4416031

Browse files
committed
PHP 8.5: Fix deprecation warning when passing null to array_key_exists()
1 parent 5f08ba5 commit 4416031

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/AccessHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static function keyExists(mixed $collection, $key, bool $magicIsAllowed =
3737
}
3838

3939
if (\is_array($collection)) {
40-
return \array_key_exists($key, $collection);
40+
return \array_key_exists($key ?? '', $collection);
4141
}
4242

4343
if ($collection instanceof ArrayAccess) {

0 commit comments

Comments
 (0)