File tree 3 files changed +45
-1
lines changed
3 files changed +45
-1
lines changed Original file line number Diff line number Diff line change 8
8
- Core:
9
9
. Fixed bug GH-17623 (Broken stack overflow detection for variable
10
10
compilation). (ilutov)
11
+ . Fixed bug GH-17618 (UnhandledMatchError does not take
12
+ zend.exception_ignore_args=1 into account). (timwolla)
11
13
12
14
- PHPDBG:
13
15
. Partially fixed bug GH-17387 (Trivial crash in phpdbg lexer). (nielsdos)
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Match expression error messages (zend.exception_ignore_args=1)
3
+ --INI--
4
+ zend.exception_ignore_args=1
5
+ --FILE--
6
+ <?php
7
+
8
+ class Beep {}
9
+
10
+ function test (mixed $ var ) {
11
+ try {
12
+ match ($ var ) {};
13
+ } catch (UnhandledMatchError $ e ) {
14
+ print $ e ->getMessage () . PHP_EOL ;
15
+ }
16
+ }
17
+
18
+ test (null );
19
+ test (1 );
20
+ test (5.5 );
21
+ test (5.0 );
22
+ test ("foo " );
23
+ test (true );
24
+ test (false );
25
+ test ([1 , 2 , 3 ]);
26
+ test (new Beep ());
27
+ // Testing long strings.
28
+ test (str_repeat ('e ' , 100 ));
29
+ test (str_repeat ("e \n" , 100 ));
30
+ ?>
31
+ --EXPECT--
32
+ Unhandled match case of type null
33
+ Unhandled match case of type int
34
+ Unhandled match case of type float
35
+ Unhandled match case of type float
36
+ Unhandled match case of type string
37
+ Unhandled match case of type bool
38
+ Unhandled match case of type bool
39
+ Unhandled match case of type array
40
+ Unhandled match case of type Beep
41
+ Unhandled match case of type string
42
+ Unhandled match case of type string
Original file line number Diff line number Diff line change @@ -872,7 +872,7 @@ ZEND_COLD void zend_match_unhandled_error(const zval *value)
872
872
{
873
873
smart_str msg = {0 };
874
874
875
- if (Z_TYPE_P (value ) <= IS_STRING ) {
875
+ if (! EG ( exception_ignore_args ) && Z_TYPE_P (value ) <= IS_STRING ) {
876
876
smart_str_append_scalar (& msg , value , EG (exception_string_param_max_len ));
877
877
} else {
878
878
smart_str_appendl (& msg , "of type " , sizeof ("of type " )- 1 );
You can’t perform that action at this time.
0 commit comments