Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php8 - catch block without var - internal error triggered #4385 #57

Closed
mitalcoi opened this issue Jan 16, 2021 · 2 comments
Closed

php8 - catch block without var - internal error triggered #4385 #57

mitalcoi opened this issue Jan 16, 2021 · 2 comments

Comments

@mitalcoi
Copy link

mitalcoi commented Jan 16, 2021

Code example:

try {
} catch (NumberReleaseFailedException){ //missed $error var - php 8 allow it
}

Error:

Internal error: PhpParser\NodeVisitorAbstract@anonymous(): Argument #1 ($catchedVariableName) must be of type string, null given, called in
vendor/thecodingmachine/phpstan-strict-rules/src/Rules/Exceptions/ThrowMustBundlePreviousExceptionRule.php on line 34

@dongm2ez
Copy link
Contributor

Proposal link: https://wiki.php.net/rfc/non-capturing_catches

@knallcharge
Copy link

Getting this, too, after updating to PHP 8, is there a plan to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants