Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #52885 [Serializer] fix nullable int cannot be serialized (nikophil)
This PR was merged into the 5.4 branch. Discussion ---------- [Serializer] fix nullable int cannot be serialized | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | License | MIT Hello, previous to [this PR](#52172) such XML could be deserialized correctly, setting null in the value: ```xml <?xml version="1.0" encoding="UTF-8"?> <DummyNullableInt> <value/> </DummyNullableInt> ``` ```php class DummyNullableInt { public function __construct( public int|null $value = null ) {} } ``` but now it creates the following error: ``` Uninitialized string offset 0 /home/nikophil/works/symfony/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php:495 /home/nikophil/works/symfony/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php:630 /home/nikophil/works/symfony/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php:377 /home/nikophil/works/symfony/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php:246 /home/nikophil/works/symfony/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php:346 ``` I looked for any issue or PR mentioning this problem, but couldn't find it. So here is a fix ping `@Jeroeny` Commits ------- 5d62dea [Serializer] fix regression where nullable int cannot be serialized
- Loading branch information