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

Better support for non-capturing catches #273

Open
flack opened this issue May 15, 2024 · 0 comments
Open

Better support for non-capturing catches #273

flack opened this issue May 15, 2024 · 0 comments

Comments

@flack
Copy link

flack commented May 15, 2024

As of PHP 8.0, you don't have to capture exceptions in a variable anymore, i.e. the following code is valid:

try {
    do_stuff();
} catch (Exception) {}

So if your PHP version is set to 8 or higher, it would be nice if PDT could show a warning for an unused variable if the code looks like this:

try {
    do_stuff();
} catch (Exception $e) {}
// Unused variable ^^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant