Skip to content

Commit d5bb7c3

Browse files
committed
minor symfony#61675 pass the empty string instead of null as key to array_key_exists() (xabbuh)
This PR was merged into the 6.4 branch. Discussion ---------- pass the empty string instead of null as key to array_key_exists() | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT Commits ------- 8efcf72 pass the empty string instead of null as key to array_key_exists()
2 parents 4d0d05a + 8efcf72 commit d5bb7c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function getChoicesForValues(array $values): array
114114
$choices = [];
115115

116116
foreach ($values as $i => $givenValue) {
117-
if (\array_key_exists($givenValue, $this->choices)) {
117+
if (\array_key_exists($givenValue ?? '', $this->choices)) {
118118
$choices[$i] = $this->choices[$givenValue];
119119
}
120120
}

0 commit comments

Comments
 (0)