Feature request
Reading the php-internals about generics, I tried to figure out a case where some failing code was accepted by phpstan (see https://externals.io/message/130816#130883).
Reproducing it in the playground indeed showed it as passing: https://phpstan.org/r/1e03afaa-4271-431e-a93d-3e3070fc5d83
Adding type dumping to debug the issue got me confused about why it would not fail: https://phpstan.org/r/3256c9e6-16ed-494c-8f1d-d9b3275d08c2
Enforcing checks for benevolent union types made me realize the truth: the type I was dumping was not actually a int|string but a benevolent union: https://phpstan.org/r/b48d6911-725d-4ac0-87d8-33430b347e4f
It would be great if PHPStan\dumpType could actually give the info about a type being a benevolent union (at least when they are not treated like normal unions) to make such debugging easier.
Did PHPStan help you today? Did it make you happy in any way?
No response
Feature request
Reading the php-internals about generics, I tried to figure out a case where some failing code was accepted by phpstan (see https://externals.io/message/130816#130883).
Reproducing it in the playground indeed showed it as passing: https://phpstan.org/r/1e03afaa-4271-431e-a93d-3e3070fc5d83
Adding type dumping to debug the issue got me confused about why it would not fail: https://phpstan.org/r/3256c9e6-16ed-494c-8f1d-d9b3275d08c2
Enforcing checks for benevolent union types made me realize the truth: the type I was dumping was not actually a
int|stringbut a benevolent union: https://phpstan.org/r/b48d6911-725d-4ac0-87d8-33430b347e4fIt would be great if
PHPStan\dumpTypecould actually give the info about a type being a benevolent union (at least when they are not treated like normal unions) to make such debugging easier.Did PHPStan help you today? Did it make you happy in any way?
No response