Bug report
Hi ✋,
I have a Symfony project with https://github.com/KnpLabs/DoctrineBehaviors.
I tried to update project to PHP8 but I'm having problem with phpstan.
Bundle created its own extensions https://github.com/KnpLabs/DoctrineBehaviors/tree/master/utils/phpstan-behaviors/src/Type
No problem with PHP7.4 but with PHP8:


After investigations, problem occurs only when method __toString is defined.
Problem appears on invoke here https://github.com/KnpLabs/DoctrineBehaviors/blob/master/utils/phpstan-behaviors/src/Type/TranslationTypeHelper.php#L36
Code snippet that reproduces the problem
https://github.com/RomulusED69/phpstan-knp-doctrine-behaviors-bug
Thanks for your help