1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
|
From 95eb63feb9ba3de78a3a64572050ef7cd5b1c5d9 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Tue, 14 Apr 2026 07:41:44 +0200
Subject: [PATCH] Fix #93 silent Warning: unexpected NAN value was coerced to
string
---
tests/Decimal/cast.phpt | 2 +-
tests/Decimal/methods/add.phpt | 18 +++++++++---------
tests/Decimal/methods/div.phpt | 24 ++++++++++++------------
tests/Decimal/methods/ln.phpt | 10 +++++-----
tests/Decimal/methods/log10.phpt | 10 +++++-----
tests/Decimal/methods/mul.phpt | 18 +++++++++---------
tests/Decimal/methods/sub.phpt | 18 +++++++++---------
tests/Number/helpers/Number.php | 2 +-
tests/Number/methods/abs.phpt | 4 ++--
tests/Number/methods/ceil.phpt | 4 ++--
tests/Number/methods/floor.phpt | 4 ++--
tests/Number/methods/trunc.phpt | 4 ++--
tests/Rational/cast.phpt | 2 +-
tests/Rational/methods/add.phpt | 18 +++++++++---------
tests/Rational/methods/div.phpt | 24 ++++++++++++------------
tests/Rational/methods/mul.phpt | 18 +++++++++---------
tests/Rational/methods/pow.phpt | 2 +-
tests/Rational/methods/sub.phpt | 2 +-
18 files changed, 92 insertions(+), 92 deletions(-)
diff --git a/tests/Decimal/cast.phpt b/tests/Decimal/cast.phpt
index b83094e..e8fd3f6 100644
--- a/tests/Decimal/cast.phpt
+++ b/tests/Decimal/cast.phpt
@@ -55,7 +55,7 @@ $tests = [
[(float) Decimal::valueOf("1234.5678E+9"), 1.2345678E+12],
[(float) Decimal::valueOf("1234.5678E+90"), 1.2345678E+93],
- [(string) (float) Decimal::valueOf( "NAN"), "NAN"],
+ [@(string) (float) Decimal::valueOf( "NAN"), "NAN"],
[(string) (float) Decimal::valueOf( "INF"), "INF"],
[(string) (float) Decimal::valueOf("-INF"), "-INF"],
diff --git a/tests/Decimal/methods/add.phpt b/tests/Decimal/methods/add.phpt
index 5ec2d98..210fb7b 100644
--- a/tests/Decimal/methods/add.phpt
+++ b/tests/Decimal/methods/add.phpt
@@ -65,15 +65,15 @@ $tests = [
],
/* Special numbers */
- [Decimal::valueOf( "NAN"), "NAN", (string) (NAN + NAN), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "NAN"), "INF", (string) (NAN + INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "NAN"), "-INF", (string) (NAN + -INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "INF"), "NAN", (string) (INF + NAN), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "INF"), "INF", (string) (INF + INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "INF"), "-INF", (string) (INF + -INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf("-INF"), "NAN", (string) (-INF + NAN), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf("-INF"), "INF", (string) (-INF + INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf("-INF"), "-INF", (string) (-INF + -INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "NAN"), "NAN", @(string) (NAN + NAN), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "NAN"), "INF", @(string) (NAN + INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "NAN"), "-INF", @(string) (NAN + -INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "INF"), "NAN", @(string) (INF + NAN), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "INF"), "INF", @(string) (INF + INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "INF"), "-INF", @(string) (INF + -INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf("-INF"), "NAN", @(string) (-INF + NAN), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf("-INF"), "INF", @(string) (-INF + INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf("-INF"), "-INF", @(string) (-INF + -INF), Decimal::DEFAULT_PRECISION],
];
foreach ($tests as $index => $test) {
diff --git a/tests/Decimal/methods/div.phpt b/tests/Decimal/methods/div.phpt
index e5db507..3da5b7f 100644
--- a/tests/Decimal/methods/div.phpt
+++ b/tests/Decimal/methods/div.phpt
@@ -52,18 +52,18 @@ $tests = [
],
/* Special numbers */
- [Decimal::valueOf(0), "NAN", (string) ( 0 / NAN), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf(0), "INF", (string) ( 0 / INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf(0), "-INF", (string) ( 0 / -INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "NAN"), "NAN", (string) (NAN / NAN), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "NAN"), "INF", (string) (NAN / INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "NAN"), "-INF", (string) (NAN / -INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "INF"), "NAN", (string) (INF / NAN), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "INF"), "INF", (string) (INF / INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "INF"), "-INF", (string) (INF / -INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf("-INF"), "NAN", (string) (-INF / NAN), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf("-INF"), "INF", (string) (-INF / INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf("-INF"), "-INF", (string) (-INF / -INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf(0), "NAN", @(string) ( 0 / NAN), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf(0), "INF", @(string) ( 0 / INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf(0), "-INF", @(string) ( 0 / -INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "NAN"), "NAN", @(string) (NAN / NAN), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "NAN"), "INF", @(string) (NAN / INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "NAN"), "-INF", @(string) (NAN / -INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "INF"), "NAN", @(string) (INF / NAN), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "INF"), "INF", @(string) (INF / INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "INF"), "-INF", @(string) (INF / -INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf("-INF"), "NAN", @(string) (-INF / NAN), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf("-INF"), "INF", @(string) (-INF / INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf("-INF"), "-INF", @(string) (-INF / -INF), Decimal::DEFAULT_PRECISION],
];
foreach ($tests as $index => $test) {
diff --git a/tests/Decimal/methods/ln.phpt b/tests/Decimal/methods/ln.phpt
index d8657b1..3a51629 100644
--- a/tests/Decimal/methods/ln.phpt
+++ b/tests/Decimal/methods/ln.phpt
@@ -34,12 +34,12 @@ $tests = [
[Decimal::valueOf("0.000123456", 50), "-8.9996257406810102209987166229396596684344507962672", 50],
/* Match PHP on special values */
- [Decimal::valueOf( "NAN"), (string) log( NAN), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf("-INF"), (string) log(-INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "INF"), (string) log( INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "NAN"), @(string) log( NAN), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf("-INF"), @(string) log(-INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "INF"), @(string) log( INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "0"), (string) log( 0), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf("-1"), (string) log(-1), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "0"), @(string) log( 0), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf("-1"), @(string) log(-1), Decimal::DEFAULT_PRECISION],
];
foreach ($tests as $test) {
diff --git a/tests/Decimal/methods/log10.phpt b/tests/Decimal/methods/log10.phpt
index 7ec063f..ee6d517 100644
--- a/tests/Decimal/methods/log10.phpt
+++ b/tests/Decimal/methods/log10.phpt
@@ -30,12 +30,12 @@ $tests = [
[Decimal::valueOf("0.000123456"), "-3.908487798372228318930600222932094", Decimal::DEFAULT_PRECISION],
[Decimal::valueOf("0.000123456", 50), "-3.9084877983722283189306002229320942053464158123113", 50],
- [Decimal::valueOf( "0"), (string) log10( 0), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "-1"), (string) log10( -1), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "0"), @(string) log10( 0), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "-1"), @(string) log10( -1), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "NAN"), (string) log10( NAN), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "INF"), (string) log10( INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf("-INF"), (string) log10(-INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "NAN"), @(string) log10( NAN), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "INF"), @(string) log10( INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf("-INF"), @(string) log10(-INF), Decimal::DEFAULT_PRECISION],
];
foreach ($tests as $test) {
diff --git a/tests/Decimal/methods/mul.phpt b/tests/Decimal/methods/mul.phpt
index e0f171f..e11aea2 100644
--- a/tests/Decimal/methods/mul.phpt
+++ b/tests/Decimal/methods/mul.phpt
@@ -58,15 +58,15 @@ $tests = [
],
/* Special numbers */
- [Decimal::valueOf( "NAN"), "NAN", (string) (NAN * NAN), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "NAN"), "INF", (string) (NAN * INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "NAN"), "-INF", (string) (NAN * -INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "INF"), "NAN", (string) (INF * NAN), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "INF"), "INF", (string) (INF * INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "INF"), "-INF", (string) (INF * -INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf("-INF"), "NAN", (string) (-INF * NAN), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf("-INF"), "INF", (string) (-INF * INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf("-INF"), "-INF", (string) (-INF * -INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "NAN"), "NAN", @(string) (NAN * NAN), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "NAN"), "INF", @(string) (NAN * INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "NAN"), "-INF", @(string) (NAN * -INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "INF"), "NAN", @(string) (INF * NAN), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "INF"), "INF", @(string) (INF * INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "INF"), "-INF", @(string) (INF * -INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf("-INF"), "NAN", @(string) (-INF * NAN), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf("-INF"), "INF", @(string) (-INF * INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf("-INF"), "-INF", @(string) (-INF * -INF), Decimal::DEFAULT_PRECISION],
[Decimal::valueOf( "NAN"), 0, "NAN", Decimal::DEFAULT_PRECISION],
[Decimal::valueOf( "INF"), 0, "NAN", Decimal::DEFAULT_PRECISION],
diff --git a/tests/Decimal/methods/sub.phpt b/tests/Decimal/methods/sub.phpt
index 6cc5018..9c019ee 100644
--- a/tests/Decimal/methods/sub.phpt
+++ b/tests/Decimal/methods/sub.phpt
@@ -62,15 +62,15 @@ $tests = [
],
/* Special numbers */
- [Decimal::valueOf( "NAN"), "NAN", (string) (NAN - NAN), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "NAN"), "INF", (string) (NAN - INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "NAN"), "-INF", (string) (NAN - -INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "INF"), "NAN", (string) (INF - NAN), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "INF"), "INF", (string) (INF - INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf( "INF"), "-INF", (string) (INF - -INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf("-INF"), "NAN", (string) (-INF - NAN), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf("-INF"), "INF", (string) (-INF - INF), Decimal::DEFAULT_PRECISION],
- [Decimal::valueOf("-INF"), "-INF", (string) (-INF - -INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "NAN"), "NAN", @(string) (NAN - NAN), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "NAN"), "INF", @(string) (NAN - INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "NAN"), "-INF", @(string) (NAN - -INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "INF"), "NAN", @(string) (INF - NAN), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "INF"), "INF", @(string) (INF - INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf( "INF"), "-INF", @(string) (INF - -INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf("-INF"), "NAN", @(string) (-INF - NAN), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf("-INF"), "INF", @(string) (-INF - INF), Decimal::DEFAULT_PRECISION],
+ [Decimal::valueOf("-INF"), "-INF", @(string) (-INF - -INF), Decimal::DEFAULT_PRECISION],
];
foreach ($tests as $index => $test) {
diff --git a/tests/Number/helpers/Number.php b/tests/Number/helpers/Number.php
index 04236a1..a3e46a1 100644
--- a/tests/Number/helpers/Number.php
+++ b/tests/Number/helpers/Number.php
@@ -110,7 +110,7 @@ public function toRational(): \Decimal\Rational
public function toString(): string
{
- return (string) $this->value;
+ return @(string) $this->value;
}
public function toInt(): int
diff --git a/tests/Number/methods/abs.phpt b/tests/Number/methods/abs.phpt
index d10c194..a070bac 100644
--- a/tests/Number/methods/abs.phpt
+++ b/tests/Number/methods/abs.phpt
@@ -13,7 +13,7 @@ print_r(Number::valueOf("-5")->abs());
print_r(Number::valueOf( 5)->abs());
print_r(Number::valueOf(-5)->abs());
-print_r(Number::valueOf( NAN)->abs());
+@print_r(Number::valueOf( NAN)->abs());
print_r(Number::valueOf( INF)->abs());
print_r(Number::valueOf(-INF)->abs());
@@ -57,4 +57,4 @@ Number::mul
Number Object
(
[value:protected] => INF
-)
\ No newline at end of file
+)
diff --git a/tests/Number/methods/ceil.phpt b/tests/Number/methods/ceil.phpt
index 05c26ea..669d50e 100644
--- a/tests/Number/methods/ceil.phpt
+++ b/tests/Number/methods/ceil.phpt
@@ -10,7 +10,7 @@ print_r(Number::valueOf("0")->ceil());
print_r(Number::valueOf( "0.1")->ceil());
print_r(Number::valueOf("-0.1")->ceil());
-print_r(Number::valueOf( NAN)->ceil());
+@print_r(Number::valueOf( NAN)->ceil());
print_r(Number::valueOf( INF)->ceil());
print_r(Number::valueOf(-INF)->ceil());
@@ -50,4 +50,4 @@ Number::toDecimal
Number Object
(
[value:protected] => -INF
-)
\ No newline at end of file
+)
diff --git a/tests/Number/methods/floor.phpt b/tests/Number/methods/floor.phpt
index 26281dc..7690152 100644
--- a/tests/Number/methods/floor.phpt
+++ b/tests/Number/methods/floor.phpt
@@ -10,7 +10,7 @@ print_r(Number::valueOf("0")->floor());
print_r(Number::valueOf( "0.1")->floor());
print_r(Number::valueOf("-0.1")->floor());
-print_r(Number::valueOf( NAN)->floor());
+@print_r(Number::valueOf( NAN)->floor());
print_r(Number::valueOf( INF)->floor());
print_r(Number::valueOf(-INF)->floor());
@@ -50,4 +50,4 @@ Number::toDecimal
Number Object
(
[value:protected] => -INF
-)
\ No newline at end of file
+)
diff --git a/tests/Number/methods/trunc.phpt b/tests/Number/methods/trunc.phpt
index d79104d..2fca527 100644
--- a/tests/Number/methods/trunc.phpt
+++ b/tests/Number/methods/trunc.phpt
@@ -10,7 +10,7 @@ print_r(Number::valueOf("0")->trunc());
print_r(Number::valueOf( "0.1")->trunc());
print_r(Number::valueOf("-0.1")->trunc());
-print_r(Number::valueOf( NAN)->trunc());
+@print_r(Number::valueOf( NAN)->trunc());
print_r(Number::valueOf( INF)->trunc());
print_r(Number::valueOf(-INF)->trunc());
@@ -50,4 +50,4 @@ Number::toDecimal
Number Object
(
[value:protected] => -INF
-)
\ No newline at end of file
+)
diff --git a/tests/Rational/cast.phpt b/tests/Rational/cast.phpt
index 7a19552..53be09f 100644
--- a/tests/Rational/cast.phpt
+++ b/tests/Rational/cast.phpt
@@ -55,7 +55,7 @@ $tests = [
[(float) Rational::valueOf("1234.5678E+9"), 1.2345678E+12],
[(float) Rational::valueOf("1234.5678E+90"), 1.2345678E+93],
- [(string) (float) Rational::valueOf( "NAN"), "NAN"],
+ [@(string) (float) Rational::valueOf( "NAN"), "NAN"],
[(string) (float) Rational::valueOf( "INF"), "INF"],
[(string) (float) Rational::valueOf("-INF"), "-INF"],
diff --git a/tests/Rational/methods/add.phpt b/tests/Rational/methods/add.phpt
index 4e36bcf..7b70e85 100644
--- a/tests/Rational/methods/add.phpt
+++ b/tests/Rational/methods/add.phpt
@@ -33,15 +33,15 @@ $tests = [
[Rational::valueOf(-1), "-1.5", "-5/2"],
/* Special numbers */
- [Rational::valueOf( "NAN"), "NAN", (string) (NAN + NAN)],
- [Rational::valueOf( "NAN"), "INF", (string) (NAN + INF)],
- [Rational::valueOf( "NAN"), "-INF", (string) (NAN + -INF)],
- [Rational::valueOf( "INF"), "NAN", (string) (INF + NAN)],
- [Rational::valueOf( "INF"), "INF", (string) (INF + INF)],
- [Rational::valueOf( "INF"), "-INF", (string) (INF + -INF)],
- [Rational::valueOf("-INF"), "NAN", (string) (-INF + NAN)],
- [Rational::valueOf("-INF"), "INF", (string) (-INF + INF)],
- [Rational::valueOf("-INF"), "-INF", (string) (-INF + -INF)],
+ [Rational::valueOf( "NAN"), "NAN", @(string) (NAN + NAN)],
+ [Rational::valueOf( "NAN"), "INF", @(string) (NAN + INF)],
+ [Rational::valueOf( "NAN"), "-INF", @(string) (NAN + -INF)],
+ [Rational::valueOf( "INF"), "NAN", @(string) (INF + NAN)],
+ [Rational::valueOf( "INF"), "INF", @(string) (INF + INF)],
+ [Rational::valueOf( "INF"), "-INF", @(string) (INF + -INF)],
+ [Rational::valueOf("-INF"), "NAN", @(string) (-INF + NAN)],
+ [Rational::valueOf("-INF"), "INF", @(string) (-INF + INF)],
+ [Rational::valueOf("-INF"), "-INF", @(string) (-INF + -INF)],
];
foreach ($tests as $index => $test) {
diff --git a/tests/Rational/methods/div.phpt b/tests/Rational/methods/div.phpt
index c2c45b5..594a59e 100644
--- a/tests/Rational/methods/div.phpt
+++ b/tests/Rational/methods/div.phpt
@@ -35,18 +35,18 @@ $tests = [
],
/* Special numbers */
- [Rational::valueOf(0), "NAN", (string) (0 / NAN)],
- [Rational::valueOf(0), "INF", (string) (0 / INF)],
- [Rational::valueOf(0), "-INF", (string) (0 / -INF)],
- [Rational::valueOf( "NAN"), "NAN", (string) (NAN / NAN)],
- [Rational::valueOf( "NAN"), "INF", (string) (NAN / INF)],
- [Rational::valueOf( "NAN"), "-INF", (string) (NAN / -INF)],
- [Rational::valueOf( "INF"), "NAN", (string) (INF / NAN)],
- [Rational::valueOf( "INF"), "INF", (string) (INF / INF)],
- [Rational::valueOf( "INF"), "-INF", (string) (INF / -INF)],
- [Rational::valueOf("-INF"), "NAN", (string) (-INF / NAN)],
- [Rational::valueOf("-INF"), "INF", (string) (-INF / INF)],
- [Rational::valueOf("-INF"), "-INF", (string) (-INF / -INF)],
+ [Rational::valueOf(0), "NAN", @(string) (0 / NAN)],
+ [Rational::valueOf(0), "INF", @(string) (0 / INF)],
+ [Rational::valueOf(0), "-INF", @(string) (0 / -INF)],
+ [Rational::valueOf( "NAN"), "NAN", @(string) (NAN / NAN)],
+ [Rational::valueOf( "NAN"), "INF", @(string) (NAN / INF)],
+ [Rational::valueOf( "NAN"), "-INF", @(string) (NAN / -INF)],
+ [Rational::valueOf( "INF"), "NAN", @(string) (INF / NAN)],
+ [Rational::valueOf( "INF"), "INF", @(string) (INF / INF)],
+ [Rational::valueOf( "INF"), "-INF", @(string) (INF / -INF)],
+ [Rational::valueOf("-INF"), "NAN", @(string) (-INF / NAN)],
+ [Rational::valueOf("-INF"), "INF", @(string) (-INF / INF)],
+ [Rational::valueOf("-INF"), "-INF", @(string) (-INF / -INF)],
];
foreach ($tests as $index => $test) {
diff --git a/tests/Rational/methods/mul.phpt b/tests/Rational/methods/mul.phpt
index 9bbd889..b7a4075 100644
--- a/tests/Rational/methods/mul.phpt
+++ b/tests/Rational/methods/mul.phpt
@@ -32,15 +32,15 @@ $tests = [
[Rational::valueOf("-1.5"), "-2.4", "18/5"],
/* Special numbers */
- [Rational::valueOf( "NAN"), "NAN", (string) (NAN * NAN)],
- [Rational::valueOf( "NAN"), "INF", (string) (NAN * INF)],
- [Rational::valueOf( "NAN"), "-INF", (string) (NAN * -INF)],
- [Rational::valueOf( "INF"), "NAN", (string) (INF * NAN)],
- [Rational::valueOf( "INF"), "INF", (string) (INF * INF)],
- [Rational::valueOf( "INF"), "-INF", (string) (INF * -INF)],
- [Rational::valueOf("-INF"), "NAN", (string) (-INF * NAN)],
- [Rational::valueOf("-INF"), "INF", (string) (-INF * INF)],
- [Rational::valueOf("-INF"), "-INF", (string) (-INF * -INF)],
+ [Rational::valueOf( "NAN"), "NAN", @(string) (NAN * NAN)],
+ [Rational::valueOf( "NAN"), "INF", @(string) (NAN * INF)],
+ [Rational::valueOf( "NAN"), "-INF", @(string) (NAN * -INF)],
+ [Rational::valueOf( "INF"), "NAN", @(string) (INF * NAN)],
+ [Rational::valueOf( "INF"), "INF", @(string) (INF * INF)],
+ [Rational::valueOf( "INF"), "-INF", @(string) (INF * -INF)],
+ [Rational::valueOf("-INF"), "NAN", @(string) (-INF * NAN)],
+ [Rational::valueOf("-INF"), "INF", @(string) (-INF * INF)],
+ [Rational::valueOf("-INF"), "-INF", @(string) (-INF * -INF)],
[Rational::valueOf( "NAN"), 0, "NAN"],
[Rational::valueOf( "INF"), 0, "NAN"],
diff --git a/tests/Rational/methods/pow.phpt b/tests/Rational/methods/pow.phpt
index 6b4da2b..f5552dd 100644
--- a/tests/Rational/methods/pow.phpt
+++ b/tests/Rational/methods/pow.phpt
@@ -107,7 +107,7 @@ foreach ($tests as $test) {
];
foreach ($results as $result) {
- if ((string) $result !== (string) $expect) {
+ if ((string) $result !== @(string) $expect) {
print_r(compact("op1", "op2", "result", "expect"));
break;
}
diff --git a/tests/Rational/methods/sub.phpt b/tests/Rational/methods/sub.phpt
index 85d3257..b8e54af 100644
--- a/tests/Rational/methods/sub.phpt
+++ b/tests/Rational/methods/sub.phpt
@@ -53,7 +53,7 @@ foreach ($tests as $index => $test) {
];
foreach ($results as $result) {
- if ((string) $result !== (string) $expect) {
+ if ((string) $result !== @(string) $expect) {
print_r(compact("index", "op1", "op2", "result", "expect"));
break;
}
|