Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Symfony/Component/Validator/ConstraintValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ protected function formatValue(mixed $value, int $format = 0): string
return 'true';
}

if (is_nan($value)) {
return 'NAN';
}

return (string) $value;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/VarDumper/Cloner/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ private function dumpItem(DumperInterface $dumper, Cursor $cursor, array &$refs,
if (!$item instanceof Stub) {
$cursor->attr = [];
$type = \gettype($item);
if ($item && 'array' === $type) {
if ('array' === $type && $item) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is probably not the only place where coercing NAN to bool can bite us, but it's the only placed caught by our test suite

$item = $this->getStub($item);
}
} elseif (Stub::TYPE_REF === $item->type) {
Expand Down
Loading