Skip to content

Better support for non-capturing catches #273

Open
@flack

Description

@flack

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 ^^

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions