Skip to content

Commit

Permalink
Add GMP test to sprintf() rope optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
TimWolla committed Jun 17, 2024
1 parent 9da37d7 commit 104a091
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions ext/standard/tests/strings/sprintf_rope_optimization_004.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--TEST--
Test sprintf() function : Rope Optimization for '%d' with GMP objects
--EXTENSIONS--
gmp
--FILE--
<?php

$a = new GMP("42");
$b = new GMP("-1337");
$c = new GMP("999999999999999999999999999999999");

try {
var_dump(sprintf("%d/%d/%d", $a, $b, $c));
} catch (\Throwable $e) {echo $e, PHP_EOL; } echo PHP_EOL;

echo "Done";
?>
--EXPECTF--
string(28) "42/-1337/4089650035136921599"

Done

0 comments on commit 104a091

Please sign in to comment.