File tree Expand file tree Collapse file tree 14 files changed +1102
-154
lines changed
Expand file tree Collapse file tree 14 files changed +1102
-154
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,8 @@ var_dump($c);
2020echo "Done \n" ;
2121?>
2222--EXPECTF--
23- Notice: Object of class stdClass could not be converted to number in %sadd_003.php on line %d
24-
2523Exception: Unsupported operand types: object + array
2624
27- Notice: Object of class stdClass could not be converted to number in %s on line %d
28-
2925Fatal error: Uncaught TypeError: Unsupported operand types: object + array in %s:%d
3026Stack trace:
3127#0 {main}
Original file line number Diff line number Diff line change @@ -9,14 +9,11 @@ class TestClass {
99abstract class AbstractClass {
1010}
1111$ 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" ;
2216}
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)
55class d { function __destruct () { throw new Exception ; } }
66try { new d + new d ; } catch (Exception $ e ) { print "Exception properly caught \n" ; }
77?>
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--
129Exception properly caught
Original file line number Diff line number Diff line change @@ -34,167 +34,167 @@ try {
3434
3535$ x = new stdClass ;
3636try { $ x += 1 ; }
37- catch (Exception $ e ) {}
37+ catch (Throwable $ e ) {}
3838var_dump ($ x );
3939
4040$ x = 1 ;
4141try { $ x += new stdClass ; }
42- catch (Exception $ e ) {}
42+ catch (Throwable $ e ) {}
4343var_dump ($ x );
4444
4545$ x = "foo " ;
4646try { $ x += new stdClass ; }
47- catch (Exception $ e ) {}
47+ catch (Throwable $ e ) {}
4848var_dump ($ x );
4949
5050$ x = new stdClass ;
5151try { $ x -= 1 ; }
52- catch (Exception $ e ) {}
52+ catch (Throwable $ e ) {}
5353var_dump ($ x );
5454
5555$ x = 1 ;
5656try { $ x -= new stdClass ; }
57- catch (Exception $ e ) {}
57+ catch (Throwable $ e ) {}
5858var_dump ($ x );
5959
6060$ x = "foo " ;
6161try { $ x -= new stdClass ; }
62- catch (Exception $ e ) {}
62+ catch (Throwable $ e ) {}
6363var_dump ($ x );
6464
6565$ x = new stdClass ;
6666try { $ x *= 1 ; }
67- catch (Exception $ e ) {}
67+ catch (Throwable $ e ) {}
6868var_dump ($ x );
6969
7070$ x = 1 ;
7171try { $ x *= new stdClass ; }
72- catch (Exception $ e ) {}
72+ catch (Throwable $ e ) {}
7373var_dump ($ x );
7474
7575$ x = "foo " ;
7676try { $ x *= new stdClass ; }
77- catch (Exception $ e ) {}
77+ catch (Throwable $ e ) {}
7878var_dump ($ x );
7979
8080$ x = new stdClass ;
8181try { $ x /= 1 ; }
82- catch (Exception $ e ) {}
82+ catch (Throwable $ e ) {}
8383var_dump ($ x );
8484
8585$ x = 1 ;
8686try { $ x /= new stdClass ; }
87- catch (Exception $ e ) {}
87+ catch (Throwable $ e ) {}
8888var_dump ($ x );
8989
9090$ x = "foo " ;
9191try { $ x /= new stdClass ; }
92- catch (Exception $ e ) {}
92+ catch (Throwable $ e ) {}
9393var_dump ($ x );
9494
9595$ x = new stdClass ;
9696try { $ x %= 1 ; }
97- catch (Exception $ e ) {}
97+ catch (Throwable $ e ) {}
9898var_dump ($ x );
9999
100100$ x = 1 ;
101101try { $ x %= new stdClass ; }
102- catch (Exception $ e ) {}
102+ catch (Throwable $ e ) {}
103103var_dump ($ x );
104104
105105$ x = "foo " ;
106106try { $ x %= new stdClass ; }
107- catch (Exception $ e ) {}
107+ catch (Throwable $ e ) {}
108108var_dump ($ x );
109109
110110$ x = new stdClass ;
111111try { $ x **= 1 ; }
112- catch (Exception $ e ) {}
112+ catch (Throwable $ e ) {}
113113var_dump ($ x );
114114
115115$ x = 1 ;
116116try { $ x **= new stdClass ; }
117- catch (Exception $ e ) {}
117+ catch (Throwable $ e ) {}
118118var_dump ($ x );
119119
120120$ x = "foo " ;
121121try { $ x **= new stdClass ; }
122- catch (Exception $ e ) {}
122+ catch (Throwable $ e ) {}
123123var_dump ($ x );
124124
125125$ x = new stdClass ;
126126try { $ x ^= 1 ; }
127- catch (Exception $ e ) {}
127+ catch (Throwable $ e ) {}
128128var_dump ($ x );
129129
130130$ x = 1 ;
131131try { $ x ^= new stdClass ; }
132- catch (Exception $ e ) {}
132+ catch (Throwable $ e ) {}
133133var_dump ($ x );
134134
135135$ x = "foo " ;
136136try { $ x ^= new stdClass ; }
137- catch (Exception $ e ) {}
137+ catch (Throwable $ e ) {}
138138var_dump ($ x );
139139
140140$ x = new stdClass ;
141141try { $ x &= 1 ; }
142- catch (Exception $ e ) {}
142+ catch (Throwable $ e ) {}
143143var_dump ($ x );
144144
145145$ x = 1 ;
146146try { $ x &= new stdClass ; }
147- catch (Exception $ e ) {}
147+ catch (Throwable $ e ) {}
148148var_dump ($ x );
149149
150150$ x = "foo " ;
151151try { $ x &= new stdClass ; }
152- catch (Exception $ e ) {}
152+ catch (Throwable $ e ) {}
153153var_dump ($ x );
154154
155155$ x = new stdClass ;
156156try { $ x |= 1 ; }
157- catch (Exception $ e ) {}
157+ catch (Throwable $ e ) {}
158158var_dump ($ x );
159159
160160$ x = 1 ;
161161try { $ x |= new stdClass ; }
162- catch (Exception $ e ) {}
162+ catch (Throwable $ e ) {}
163163var_dump ($ x );
164164
165165$ x = "foo " ;
166166try { $ x |= new stdClass ; }
167- catch (Exception $ e ) {}
167+ catch (Throwable $ e ) {}
168168var_dump ($ x );
169169
170170$ x = new stdClass ;
171171try { $ x <<= 1 ; }
172- catch (Exception $ e ) {}
172+ catch (Throwable $ e ) {}
173173var_dump ($ x );
174174
175175$ x = 1 ;
176176try { $ x <<= new stdClass ; }
177- catch (Exception $ e ) {}
177+ catch (Throwable $ e ) {}
178178var_dump ($ x );
179179
180180$ x = "foo " ;
181181try { $ x <<= new stdClass ; }
182- catch (Exception $ e ) {}
182+ catch (Throwable $ e ) {}
183183var_dump ($ x );
184184
185185$ x = new stdClass ;
186186try { $ x >>= 1 ; }
187- catch (Exception $ e ) {}
187+ catch (Throwable $ e ) {}
188188var_dump ($ x );
189189
190190$ x = 1 ;
191191try { $ x >>= new stdClass ; }
192- catch (Exception $ e ) {}
192+ catch (Throwable $ e ) {}
193193var_dump ($ x );
194194
195195$ x = "foo " ;
196196try { $ x >>= new stdClass ; }
197- catch (Exception $ e ) {}
197+ catch (Throwable $ e ) {}
198198var_dump ($ x );
199199
200200?>
Original file line number Diff line number Diff line change @@ -26,13 +26,18 @@ $a = array(
2626);
2727
2828foreach ($ a as $ var ) {
29- $ var --;
29+ try {
30+ $ var --;
31+ } catch (TypeError $ e ) {
32+ echo $ e ->getMessage (), "\n" ;
33+ }
3034 var_dump ($ var );
3135}
3236
3337echo "Done \n" ;
3438?>
35- --EXPECTF--
39+ --EXPECT--
40+ Cannot decrement array
3641array(3) {
3742 [0]=>
3843 int(1)
@@ -51,8 +56,10 @@ float(1.5)
5156NULL
5257bool(true)
5358bool(false)
54- object(stdClass)#%d (0) {
59+ Cannot decrement object
60+ object(stdClass)#1 (0) {
5561}
62+ Cannot decrement array
5663array(0) {
5764}
5865float(-9.223372036854776E+18)
You can’t perform that action at this time.
0 commit comments