Skip to content

ArrayAccess::offsetSet() may throw an exception #4852

@szepeviktor

Description

@szepeviktor

Bug report

When ArrayAccess::offsetSet() throws an exception PHPStan thinks

try {
    $store[] = $carrier;
} catch ( \Exception $e ) {

the catch block is never executed.

Code snippet that reproduces the problem

https://phpstan.org/r/a409c5cc-ba0f-4383-8bd0-c2a5ba791f86

Expected output

No error.

Please advise.
Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions