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

php 7.1 multiple exceptions using the pipe (|) character #205

Closed
amir-khoshbakht opened this issue Jan 11, 2022 · 1 comment
Closed

php 7.1 multiple exceptions using the pipe (|) character #205

amir-khoshbakht opened this issue Jan 11, 2022 · 1 comment
Milestone

Comments

@amir-khoshbakht
Copy link

amir-khoshbakht commented Jan 11, 2022

The behavior of the software is unexpected when I use several different types of Exceptions by pipe.

class FirstException extends Exception
{

}
class SecondException extends Exception
{

}

        $a = new Deferred();
        $a->reject(new Exception('test'));

        $a->promise()
            // this will cause TypeError
            ->otherwise(function (FirstException|SecondException $exception) {
               // no exception here
            })
            ->otherwise(function (Exception $exception) {
                // also no exception here
            })
            ->otherwise(function ($exception) {
                // type error exception occurs here
            });

the situation get worse when developer don't use :
error_reporting(error_reporting() & ~E_DEPRECATED);
PHP 8.0.11

@amir-khoshbakht
Copy link
Author

it seems it is addressed here: #198 and here: #181

@clue clue added this to the v2.9.0 milestone Jan 30, 2022
@clue clue removed the bug label Jun 8, 2022
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

2 participants