3v4l.org

run code in 300+ PHP versions simultaneously
<?php function gmp_base_convert($numStr,$base){ $gnum = gmp_init($numStr); return gmp_strval($gnum,$base); } $binary = gmp_base_convert("-65",2); echo "$binary (binary)"; $i = intval($binary,2); $decimal = gmp_base_convert($i,10); echo "\n$decimal (decimal)"; //echo gmp_base_convert("0.5",16); echo "\n",gmp_base_convert("2A4",16);
Output for git.master, git.master_jit, rfc.property-hooks
-1000001 (binary) -65 (decimal) Fatal error: Uncaught ValueError: gmp_init(): Argument #1 ($num) is not an integer string in /in/hBe7m:5 Stack trace: #0 /in/hBe7m(5): gmp_init('2A4') #1 /in/hBe7m(15): gmp_base_convert('2A4', 16) #2 {main} thrown in /in/hBe7m on line 5
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
71.81 ms | 401 KiB | 8 Q