-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GMP test to sprintf() rope optimization
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
ext/standard/tests/strings/sprintf_rope_optimization_004.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |