phpdoc-parser
phpdoc-parser copied to clipboard
Cannot use backslash as a literal string in conditional return type
i can't get phpstan to recognise \\
in a literal string:
https://phpstan.org/r/41f1530f-eaee-4e7d-8bfc-e7ccc7cfc7a7
using any other sting there makes it work just fine: https://phpstan.org/r/a884b37d-682b-45a4-b891-1725ffd1c428
Originally posted by @mad-briller in https://github.com/phpstan/phpstan/issues/7483#issuecomment-1200168302
This is actually a feature request for phpstan/phpdoc-parser - it only trims away the surrounding quotes but doesn't un-escape the string otherwise, so '\\'
actually becomes '\\\\'
.
Changing this is technically a BC break though :/
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.