-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zend_execute: Suppress values in
UnhandledMatchError
for `zend.exce…
- Loading branch information
Showing
3 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--TEST-- | ||
Match expression error messages (zend.exception_ignore_args=1) | ||
--INI-- | ||
zend.exception_ignore_args=1 | ||
--FILE-- | ||
<?php | ||
|
||
class Beep {} | ||
|
||
function test(mixed $var) { | ||
try { | ||
match($var) {}; | ||
} catch (UnhandledMatchError $e) { | ||
print $e->getMessage() . PHP_EOL; | ||
} | ||
} | ||
|
||
test(null); | ||
test(1); | ||
test(5.5); | ||
test(5.0); | ||
test("foo"); | ||
test(true); | ||
test(false); | ||
test([1, 2, 3]); | ||
test(new Beep()); | ||
// Testing long strings. | ||
test(str_repeat('e', 100)); | ||
test(str_repeat("e\n", 100)); | ||
?> | ||
--EXPECT-- | ||
Unhandled match case of type null | ||
Unhandled match case of type int | ||
Unhandled match case of type float | ||
Unhandled match case of type float | ||
Unhandled match case of type string | ||
Unhandled match case of type bool | ||
Unhandled match case of type bool | ||
Unhandled match case of type array | ||
Unhandled match case of type Beep | ||
Unhandled match case of type string | ||
Unhandled match case of type string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters