Skip to content

Commit 2e2c450

Browse files
committed
PHP 8.5: Fix deprecation warning when passing null to array_key_exists()
1 parent a215cc1 commit 2e2c450

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)