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

UnhandledMatchError does not take zend.exception_ignore_args=1 into account #17618

Closed
TimWolla opened this issue Jan 29, 2025 · 1 comment
Closed

Comments

@TimWolla
Copy link
Member

Description

The following code:

<?php

ini_set('zend.exception_ignore_args', '1');

try {
    match (1) { };
} catch (Error $e) { echo $e->getMessage(), PHP_EOL; }

try {
    match ("foo bar baz foo bar baz") { };
} catch (Error $e) { echo $e->getMessage(), PHP_EOL; }

https://3v4l.org/Xen86

Resulted in this output:

Unhandled match case 1
Unhandled match case 'foo bar baz foo...'

But I expected this output instead:

Unhandled match case of type int
Unhandled match case of type string

PHP Version

PHP 8.1.0 - PHP 8.4.3

Operating System

No response

@TimWolla
Copy link
Member Author

Spun out of #17601, after I got the (private) feedback, that this should be considered a bug.

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