Skip to content

Commit

Permalink
Fix sprintf_rope_optimization_004.phpt for 32-bit versions
Browse files Browse the repository at this point in the history
  • Loading branch information
TimWolla committed Jun 17, 2024
1 parent 2c5ed50 commit 9907389
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9907389

Please sign in to comment.