Skip to content

Commit 9907389

Browse files
committed
Fix sprintf_rope_optimization_004.phpt for 32-bit versions
see 2c5ed50
1 parent 2c5ed50 commit 9907389

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ext/standard/tests/strings/sprintf_rope_optimization_004.phpt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,19 @@ $b = new GMP("-1337");
1010
$c = new GMP("999999999999999999999999999999999");
1111

1212
try {
13-
var_dump(sprintf("%d/%d/%d/%s", $a, $b, $c, $c + 1));
13+
if (PHP_INT_SIZE == 8) {
14+
var_dump(sprintf("%d/%d/%d/%s", $a, $b, $c, $c + 1));
15+
var_dump("42/-1337/2147483647/1000000000000000000000000000000000");
16+
} else {
17+
var_dump("42/-1337/4089650035136921599/1000000000000000000000000000000000");
18+
var_dump(sprintf("%d/%d/%d/%s", $a, $b, $c, $c + 1));
19+
}
1420
} catch (\Throwable $e) {echo $e, PHP_EOL; } echo PHP_EOL;
1521

1622
echo "Done";
1723
?>
1824
--EXPECTF--
1925
string(63) "42/-1337/4089650035136921599/1000000000000000000000000000000000"
26+
string(54) "42/-1337/2147483647/1000000000000000000000000000000000"
2027

2128
Done

0 commit comments

Comments
 (0)