File tree 14 files changed +1102
-154
lines changed 14 files changed +1102
-154
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,8 @@ var_dump($c);
20
20
echo "Done \n" ;
21
21
?>
22
22
--EXPECTF--
23
- Notice: Object of class stdClass could not be converted to number in %sadd_003.php on line %d
24
-
25
23
Exception: Unsupported operand types: object + array
26
24
27
- Notice: Object of class stdClass could not be converted to number in %s on line %d
28
-
29
25
Fatal error: Uncaught TypeError: Unsupported operand types: object + array in %s:%d
30
26
Stack trace:
31
27
#0 {main}
Original file line number Diff line number Diff line change @@ -9,14 +9,11 @@ class TestClass {
9
9
abstract class AbstractClass {
10
10
}
11
11
$ methodWithArgs = new ReflectionMethod ('TestClass ' , 'methodWithArgs ' );
12
- echo $ methodWithArgs ++;
13
- ?>
14
- --EXPECTF--
15
- Method [ <user> public method methodWithArgs ] {
16
- @@ %sbug54305.php %d - %d
17
-
18
- - Parameters [2] {
19
- Parameter #0 [ <required> $a ]
20
- Parameter #1 [ <required> $b ]
21
- }
12
+ try {
13
+ echo $ methodWithArgs ++;
14
+ } catch (TypeError $ e ) {
15
+ echo $ e ->getMessage (), "\n" ;
22
16
}
17
+ ?>
18
+ --EXPECT--
19
+ Cannot increment object
Original file line number Diff line number Diff line change @@ -5,8 +5,5 @@ Bug #73337 (try/catch not working with two exceptions inside a same operation)
5
5
class d { function __destruct () { throw new Exception ; } }
6
6
try { new d + new d ; } catch (Exception $ e ) { print "Exception properly caught \n" ; }
7
7
?>
8
- --EXPECTF--
9
- Notice: Object of class d could not be converted to number in %sbug73337.php on line 3
10
-
11
- Notice: Object of class d could not be converted to number in %sbug73337.php on line 3
8
+ --EXPECT--
12
9
Exception properly caught
Original file line number Diff line number Diff line change @@ -34,167 +34,167 @@ try {
34
34
35
35
$ x = new stdClass ;
36
36
try { $ x += 1 ; }
37
- catch (Exception $ e ) {}
37
+ catch (Throwable $ e ) {}
38
38
var_dump ($ x );
39
39
40
40
$ x = 1 ;
41
41
try { $ x += new stdClass ; }
42
- catch (Exception $ e ) {}
42
+ catch (Throwable $ e ) {}
43
43
var_dump ($ x );
44
44
45
45
$ x = "foo " ;
46
46
try { $ x += new stdClass ; }
47
- catch (Exception $ e ) {}
47
+ catch (Throwable $ e ) {}
48
48
var_dump ($ x );
49
49
50
50
$ x = new stdClass ;
51
51
try { $ x -= 1 ; }
52
- catch (Exception $ e ) {}
52
+ catch (Throwable $ e ) {}
53
53
var_dump ($ x );
54
54
55
55
$ x = 1 ;
56
56
try { $ x -= new stdClass ; }
57
- catch (Exception $ e ) {}
57
+ catch (Throwable $ e ) {}
58
58
var_dump ($ x );
59
59
60
60
$ x = "foo " ;
61
61
try { $ x -= new stdClass ; }
62
- catch (Exception $ e ) {}
62
+ catch (Throwable $ e ) {}
63
63
var_dump ($ x );
64
64
65
65
$ x = new stdClass ;
66
66
try { $ x *= 1 ; }
67
- catch (Exception $ e ) {}
67
+ catch (Throwable $ e ) {}
68
68
var_dump ($ x );
69
69
70
70
$ x = 1 ;
71
71
try { $ x *= new stdClass ; }
72
- catch (Exception $ e ) {}
72
+ catch (Throwable $ e ) {}
73
73
var_dump ($ x );
74
74
75
75
$ x = "foo " ;
76
76
try { $ x *= new stdClass ; }
77
- catch (Exception $ e ) {}
77
+ catch (Throwable $ e ) {}
78
78
var_dump ($ x );
79
79
80
80
$ x = new stdClass ;
81
81
try { $ x /= 1 ; }
82
- catch (Exception $ e ) {}
82
+ catch (Throwable $ e ) {}
83
83
var_dump ($ x );
84
84
85
85
$ x = 1 ;
86
86
try { $ x /= new stdClass ; }
87
- catch (Exception $ e ) {}
87
+ catch (Throwable $ e ) {}
88
88
var_dump ($ x );
89
89
90
90
$ x = "foo " ;
91
91
try { $ x /= new stdClass ; }
92
- catch (Exception $ e ) {}
92
+ catch (Throwable $ e ) {}
93
93
var_dump ($ x );
94
94
95
95
$ x = new stdClass ;
96
96
try { $ x %= 1 ; }
97
- catch (Exception $ e ) {}
97
+ catch (Throwable $ e ) {}
98
98
var_dump ($ x );
99
99
100
100
$ x = 1 ;
101
101
try { $ x %= new stdClass ; }
102
- catch (Exception $ e ) {}
102
+ catch (Throwable $ e ) {}
103
103
var_dump ($ x );
104
104
105
105
$ x = "foo " ;
106
106
try { $ x %= new stdClass ; }
107
- catch (Exception $ e ) {}
107
+ catch (Throwable $ e ) {}
108
108
var_dump ($ x );
109
109
110
110
$ x = new stdClass ;
111
111
try { $ x **= 1 ; }
112
- catch (Exception $ e ) {}
112
+ catch (Throwable $ e ) {}
113
113
var_dump ($ x );
114
114
115
115
$ x = 1 ;
116
116
try { $ x **= new stdClass ; }
117
- catch (Exception $ e ) {}
117
+ catch (Throwable $ e ) {}
118
118
var_dump ($ x );
119
119
120
120
$ x = "foo " ;
121
121
try { $ x **= new stdClass ; }
122
- catch (Exception $ e ) {}
122
+ catch (Throwable $ e ) {}
123
123
var_dump ($ x );
124
124
125
125
$ x = new stdClass ;
126
126
try { $ x ^= 1 ; }
127
- catch (Exception $ e ) {}
127
+ catch (Throwable $ e ) {}
128
128
var_dump ($ x );
129
129
130
130
$ x = 1 ;
131
131
try { $ x ^= new stdClass ; }
132
- catch (Exception $ e ) {}
132
+ catch (Throwable $ e ) {}
133
133
var_dump ($ x );
134
134
135
135
$ x = "foo " ;
136
136
try { $ x ^= new stdClass ; }
137
- catch (Exception $ e ) {}
137
+ catch (Throwable $ e ) {}
138
138
var_dump ($ x );
139
139
140
140
$ x = new stdClass ;
141
141
try { $ x &= 1 ; }
142
- catch (Exception $ e ) {}
142
+ catch (Throwable $ e ) {}
143
143
var_dump ($ x );
144
144
145
145
$ x = 1 ;
146
146
try { $ x &= new stdClass ; }
147
- catch (Exception $ e ) {}
147
+ catch (Throwable $ e ) {}
148
148
var_dump ($ x );
149
149
150
150
$ x = "foo " ;
151
151
try { $ x &= new stdClass ; }
152
- catch (Exception $ e ) {}
152
+ catch (Throwable $ e ) {}
153
153
var_dump ($ x );
154
154
155
155
$ x = new stdClass ;
156
156
try { $ x |= 1 ; }
157
- catch (Exception $ e ) {}
157
+ catch (Throwable $ e ) {}
158
158
var_dump ($ x );
159
159
160
160
$ x = 1 ;
161
161
try { $ x |= new stdClass ; }
162
- catch (Exception $ e ) {}
162
+ catch (Throwable $ e ) {}
163
163
var_dump ($ x );
164
164
165
165
$ x = "foo " ;
166
166
try { $ x |= new stdClass ; }
167
- catch (Exception $ e ) {}
167
+ catch (Throwable $ e ) {}
168
168
var_dump ($ x );
169
169
170
170
$ x = new stdClass ;
171
171
try { $ x <<= 1 ; }
172
- catch (Exception $ e ) {}
172
+ catch (Throwable $ e ) {}
173
173
var_dump ($ x );
174
174
175
175
$ x = 1 ;
176
176
try { $ x <<= new stdClass ; }
177
- catch (Exception $ e ) {}
177
+ catch (Throwable $ e ) {}
178
178
var_dump ($ x );
179
179
180
180
$ x = "foo " ;
181
181
try { $ x <<= new stdClass ; }
182
- catch (Exception $ e ) {}
182
+ catch (Throwable $ e ) {}
183
183
var_dump ($ x );
184
184
185
185
$ x = new stdClass ;
186
186
try { $ x >>= 1 ; }
187
- catch (Exception $ e ) {}
187
+ catch (Throwable $ e ) {}
188
188
var_dump ($ x );
189
189
190
190
$ x = 1 ;
191
191
try { $ x >>= new stdClass ; }
192
- catch (Exception $ e ) {}
192
+ catch (Throwable $ e ) {}
193
193
var_dump ($ x );
194
194
195
195
$ x = "foo " ;
196
196
try { $ x >>= new stdClass ; }
197
- catch (Exception $ e ) {}
197
+ catch (Throwable $ e ) {}
198
198
var_dump ($ x );
199
199
200
200
?>
Original file line number Diff line number Diff line change @@ -26,13 +26,18 @@ $a = array(
26
26
);
27
27
28
28
foreach ($ a as $ var ) {
29
- $ var --;
29
+ try {
30
+ $ var --;
31
+ } catch (TypeError $ e ) {
32
+ echo $ e ->getMessage (), "\n" ;
33
+ }
30
34
var_dump ($ var );
31
35
}
32
36
33
37
echo "Done \n" ;
34
38
?>
35
- --EXPECTF--
39
+ --EXPECT--
40
+ Cannot decrement array
36
41
array(3) {
37
42
[0]=>
38
43
int(1)
@@ -51,8 +56,10 @@ float(1.5)
51
56
NULL
52
57
bool(true)
53
58
bool(false)
54
- object(stdClass)#%d (0) {
59
+ Cannot decrement object
60
+ object(stdClass)#1 (0) {
55
61
}
62
+ Cannot decrement array
56
63
array(0) {
57
64
}
58
65
float(-9.223372036854776E+18)
You can’t perform that action at this time.
0 commit comments