Fix sprintf_rope_optimization_004.phpt for 32-bit versions

see 2c5ed50d5c
This commit is contained in:
Tim Düsterhus 2024-06-17 17:45:23 +02:00
parent 2c5ed50d5c
commit 9907389007
No known key found for this signature in database
GPG Key ID: 8FF75566094168AF

View File

@ -10,12 +10,19 @@ $b = new GMP("-1337");
$c = new GMP("999999999999999999999999999999999");
try {
var_dump(sprintf("%d/%d/%d/%s", $a, $b, $c, $c + 1));
if (PHP_INT_SIZE == 8) {
var_dump(sprintf("%d/%d/%d/%s", $a, $b, $c, $c + 1));
var_dump("42/-1337/2147483647/1000000000000000000000000000000000");
} else {
var_dump("42/-1337/4089650035136921599/1000000000000000000000000000000000");
var_dump(sprintf("%d/%d/%d/%s", $a, $b, $c, $c + 1));
}
} catch (\Throwable $e) {echo $e, PHP_EOL; } echo PHP_EOL;
echo "Done";
?>
--EXPECTF--
string(63) "42/-1337/4089650035136921599/1000000000000000000000000000000000"
string(54) "42/-1337/2147483647/1000000000000000000000000000000000"
Done