Skip to content

built-in ErrorException $previous should be of type Throwable #13267

@krchiper

Description

@krchiper

Bug report

It seems stub file for ErrorException $previous argument has been changed to \Exception from \Throwable in version 2.1.8, is this intentional?

According to php.net it should be \Throwable: https://www.php.net/manual/en/class.errorexception.php

Image

Code snippet that reproduces the problem

https://phpstan.org/r/15dccc67-9aa6-431c-be63-ea56d319aa19

Expected output

Should work with providing a Throwable to ErrorException

Did PHPStan help you today? Did it make you happy in any way?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions