@@ -377,14 +377,16 @@ public function testFormatFractionDigits($value, $expected, $fractionDigits = nu
377
377
378
378
public function formatFractionDigitsProvider ()
379
379
{
380
- return [
381
- [1.123 , '1.123 ' , null , 0 ],
382
- [1.123 , '1 ' , 0 , 0 ],
383
- [1.123 , '1.1 ' , 1 , 1 ],
384
- [1.123 , '1.12 ' , 2 , 2 ],
385
- [1.123 , '1.123 ' , -1 , 0 ],
386
- [1.123 , '1 ' , 'abc ' , 0 ],
387
- ];
380
+ yield [1.123 , '1.123 ' , null , 0 ];
381
+ yield [1.123 , '1 ' , 0 , 0 ];
382
+ yield [1.123 , '1.1 ' , 1 , 1 ];
383
+ yield [1.123 , '1.12 ' , 2 , 2 ];
384
+ yield [1.123 , '1.123 ' , -1 , 0 ];
385
+
386
+ if (\PHP_VERSION_ID < 80000 ) {
387
+ // This dataset will produce a TypeError on php 8.
388
+ yield [1.123 , '1 ' , 'abc ' , 0 ];
389
+ }
388
390
}
389
391
390
392
/**
@@ -410,14 +412,16 @@ public function testFormatGroupingUsed($value, $expected, $groupingUsed = null,
410
412
411
413
public function formatGroupingUsedProvider ()
412
414
{
413
- return [
414
- [1000 , '1,000 ' , null , 1 ],
415
- [1000 , '1000 ' , 0 , 0 ],
416
- [1000 , '1,000 ' , 1 , 1 ],
417
- [1000 , '1,000 ' , 2 , 1 ],
418
- [1000 , '1000 ' , 'abc ' , 0 ],
419
- [1000 , '1,000 ' , -1 , 1 ],
420
- ];
415
+ yield [1000 , '1,000 ' , null , 1 ];
416
+ yield [1000 , '1000 ' , 0 , 0 ];
417
+ yield [1000 , '1,000 ' , 1 , 1 ];
418
+ yield [1000 , '1,000 ' , 2 , 1 ];
419
+ yield [1000 , '1,000 ' , -1 , 1 ];
420
+
421
+ if (\PHP_VERSION_ID < 80000 ) {
422
+ // This dataset will produce a TypeError on php 8.
423
+ yield [1000 , '1000 ' , 'abc ' , 0 ];
424
+ }
421
425
}
422
426
423
427
/**
0 commit comments