-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
phpstan/phpstan-src
#3770Labels
Milestone
Description
Bug report
I have noticed a possible bug. Given the following code the following error will be emitted:
Method HelloWorld::test() should return array{id?: int, categories?: array} but returns array<'categories'|'id', 1|array{'news'}>.
Code snippet that reproduces the problem
Reproduction: https://phpstan.org/r/04dbfd87-93d6-485c-887e-15cd0d342f37
I noticed that the error only gets thrown when both of the array keys are set, When omitting either id or categories no error will be emitted.
Expected output
No errors
Did PHPStan help you today? Did it make you happy in any way?
Yes 🙂
Reactions are currently unavailable