### Bug report I have some errors with nested types. PhpStan seems to accept wrong types but does not accept correct type. https://github.com/phpstan/phpstan/discussions/13994 ### Code snippet that reproduces the problem https://phpstan.org/r/f853cba7-6ea6-4b83-a58c-4d6884ea721c https://phpstan.org/r/e933925c-b8ef-4a12-bc62-4c5db8b7890e ### Expected output Expected output -> no errors! ### Did PHPStan help you today? Did it make you happy in any way? _No response_
Activity
ondrejmirtes commentedon Feb 10, 2026
/cc @jiripudil Is this code sound even with invariant
@template?jiripudil commentedon Feb 10, 2026
Hi, yep, the code looks absolutely fine.
It's just a hunch, but my first thought went to #9074 (reply in thread) (
MixedTypevsStrictMixedTypein an ancestor) – was that ever remediated?ondrejmirtes commentedon Feb 10, 2026
It wasn't yet. But it's probably the cause here because no error is reported on level 8?
jiripudil commentedon Feb 10, 2026
Looks like it then. The problem goes away when you replace
mixedwith a specific type in the first reproduction.