@@ -23,10 +23,14 @@ $otherVals = array(0, 1, -1, 7, 9, 65, -44, MAX_32Bit, MAX_64Bit);
23
23
error_reporting (E_ERROR );
24
24
25
25
foreach ($ longVals as $ longVal ) {
26
- foreach ($ otherVals as $ otherVal ) {
27
- echo "--- testing: $ longVal / $ otherVal --- \n" ;
28
- var_dump ($ longVal /$ otherVal );
29
- }
26
+ foreach ($ otherVals as $ otherVal ) {
27
+ echo "--- testing: $ longVal / $ otherVal --- \n" ;
28
+ try {
29
+ var_dump ($ longVal /$ otherVal );
30
+ } catch (\Throwable $ e ) {
31
+ echo get_class ($ e ) . ': ' . $ e ->getMessage () . \PHP_EOL ;
32
+ }
33
+ }
30
34
}
31
35
32
36
foreach ($ otherVals as $ otherVal ) {
@@ -39,7 +43,7 @@ foreach ($otherVals as $otherVal) {
39
43
?>
40
44
--EXPECT--
41
45
--- testing: 9223372036854775807 / 0 ---
42
- float(INF)
46
+ DivisionByZeroError: Division by zero
43
47
--- testing: 9223372036854775807 / 1 ---
44
48
int(9223372036854775807)
45
49
--- testing: 9223372036854775807 / -1 ---
@@ -57,7 +61,7 @@ float(4294967298)
57
61
--- testing: 9223372036854775807 / 9223372036854775807 ---
58
62
int(1)
59
63
--- testing: -9223372036854775808 / 0 ---
60
- float(-INF)
64
+ DivisionByZeroError: Division by zero
61
65
--- testing: -9223372036854775808 / 1 ---
62
66
int(-9223372036854775808)
63
67
--- testing: -9223372036854775808 / -1 ---
@@ -75,7 +79,7 @@ float(-4294967298)
75
79
--- testing: -9223372036854775808 / 9223372036854775807 ---
76
80
float(-1)
77
81
--- testing: 2147483647 / 0 ---
78
- float(INF)
82
+ DivisionByZeroError: Division by zero
79
83
--- testing: 2147483647 / 1 ---
80
84
int(2147483647)
81
85
--- testing: 2147483647 / -1 ---
93
97
--- testing: 2147483647 / 9223372036854775807 ---
94
98
float(2.328306435454494E-10)
95
99
--- testing: -2147483648 / 0 ---
96
- float(-INF)
100
+ DivisionByZeroError: Division by zero
97
101
--- testing: -2147483648 / 1 ---
98
102
int(-2147483648)
99
103
--- testing: -2147483648 / -1 ---
@@ -111,7 +115,7 @@ float(-1.0000000004656613)
111
115
--- testing: -2147483648 / 9223372036854775807 ---
112
116
float(-2.3283064365386963E-10)
113
117
--- testing: 9223372034707292160 / 0 ---
114
- float(INF)
118
+ DivisionByZeroError: Division by zero
115
119
--- testing: 9223372034707292160 / 1 ---
116
120
int(9223372034707292160)
117
121
--- testing: 9223372034707292160 / -1 ---
@@ -129,7 +133,7 @@ float(4294967297)
129
133
--- testing: 9223372034707292160 / 9223372036854775807 ---
130
134
float(0.9999999997671694)
131
135
--- testing: -9223372034707292160 / 0 ---
132
- float(-INF)
136
+ DivisionByZeroError: Division by zero
133
137
--- testing: -9223372034707292160 / 1 ---
134
138
int(-9223372034707292160)
135
139
--- testing: -9223372034707292160 / -1 ---
@@ -147,7 +151,7 @@ float(-4294967297)
147
151
--- testing: -9223372034707292160 / 9223372036854775807 ---
148
152
float(-0.9999999997671694)
149
153
--- testing: 2147483648 / 0 ---
150
- float(INF)
154
+ DivisionByZeroError: Division by zero
151
155
--- testing: 2147483648 / 1 ---
152
156
int(2147483648)
153
157
--- testing: 2147483648 / -1 ---
@@ -165,7 +169,7 @@ float(1.0000000004656613)
165
169
--- testing: 2147483648 / 9223372036854775807 ---
166
170
float(2.3283064365386963E-10)
167
171
--- testing: -2147483649 / 0 ---
168
- float(-INF)
172
+ DivisionByZeroError: Division by zero
169
173
--- testing: -2147483649 / 1 ---
170
174
int(-2147483649)
171
175
--- testing: -2147483649 / -1 ---
@@ -183,7 +187,7 @@ float(-1.0000000009313226)
183
187
--- testing: -2147483649 / 9223372036854775807 ---
184
188
float(-2.3283064376228985E-10)
185
189
--- testing: 4294967294 / 0 ---
186
- float(INF)
190
+ DivisionByZeroError: Division by zero
187
191
--- testing: 4294967294 / 1 ---
188
192
int(4294967294)
189
193
--- testing: 4294967294 / -1 ---
@@ -201,7 +205,7 @@ int(2)
201
205
--- testing: 4294967294 / 9223372036854775807 ---
202
206
float(4.656612870908988E-10)
203
207
--- testing: 4294967295 / 0 ---
204
- float(INF)
208
+ DivisionByZeroError: Division by zero
205
209
--- testing: 4294967295 / 1 ---
206
210
int(4294967295)
207
211
--- testing: 4294967295 / -1 ---
@@ -219,7 +223,7 @@ float(2.0000000004656613)
219
223
--- testing: 4294967295 / 9223372036854775807 ---
220
224
float(4.6566128719931904E-10)
221
225
--- testing: 4294967293 / 0 ---
222
- float(INF)
226
+ DivisionByZeroError: Division by zero
223
227
--- testing: 4294967293 / 1 ---
224
228
int(4294967293)
225
229
--- testing: 4294967293 / -1 ---
@@ -237,7 +241,7 @@ float(1.9999999995343387)
237
241
--- testing: 4294967293 / 9223372036854775807 ---
238
242
float(4.656612869824786E-10)
239
243
--- testing: 9223372036854775806 / 0 ---
240
- float(INF)
244
+ DivisionByZeroError: Division by zero
241
245
--- testing: 9223372036854775806 / 1 ---
242
246
int(9223372036854775806)
243
247
--- testing: 9223372036854775806 / -1 ---
@@ -255,7 +259,7 @@ int(4294967298)
255
259
--- testing: 9223372036854775806 / 9223372036854775807 ---
256
260
float(1)
257
261
--- testing: 9.2233720368548E+18 / 0 ---
258
- float(INF)
262
+ DivisionByZeroError: Division by zero
259
263
--- testing: 9.2233720368548E+18 / 1 ---
260
264
float(9.223372036854776E+18)
261
265
--- testing: 9.2233720368548E+18 / -1 ---
@@ -273,7 +277,7 @@ float(4294967298)
273
277
--- testing: 9.2233720368548E+18 / 9223372036854775807 ---
274
278
float(1)
275
279
--- testing: -9223372036854775807 / 0 ---
276
- float(-INF)
280
+ DivisionByZeroError: Division by zero
277
281
--- testing: -9223372036854775807 / 1 ---
278
282
int(-9223372036854775807)
279
283
--- testing: -9223372036854775807 / -1 ---
@@ -291,7 +295,7 @@ float(-4294967298)
291
295
--- testing: -9223372036854775807 / 9223372036854775807 ---
292
296
int(-1)
293
297
--- testing: -9.2233720368548E+18 / 0 ---
294
- float(-INF)
298
+ DivisionByZeroError: Division by zero
295
299
--- testing: -9.2233720368548E+18 / 1 ---
296
300
float(-9.223372036854776E+18)
297
301
--- testing: -9.2233720368548E+18 / -1 ---
0 commit comments