3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = gmp_init(42); $b = gmp_init(17); // Pre-5.6 code: var_dump(gmp_add($a, $b)); var_dump(gmp_add($a, 17)); var_dump(gmp_add(42, $b));
Output for 5.6.8 - 5.6.20, 5.6.28 - 7.0.5, 7.0.20 - 7.2.0
object(GMP)#3 (1) { ["num"]=> string(2) "59" } object(GMP)#3 (1) { ["num"]=> string(2) "59" } object(GMP)#3 (1) { ["num"]=> string(2) "59" }
Output for 7.0.6
Fatal error: Uncaught Error: Call to undefined function gmp_init() in /in/dL38t:2 Stack trace: #0 {main} thrown in /in/dL38t on line 2
Process exited with code 255.
Output for 5.0.0 - 5.3.29, 5.5.35, 5.6.21
Fatal error: Call to undefined function gmp_init() in /in/dL38t on line 2
Process exited with code 255.
Output for 5.4.0 - 5.5.34
resource(6) of type (GMP integer) resource(7) of type (GMP integer) resource(9) of type (GMP integer)
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: gmp_init() in /in/dL38t on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: gmp_init() in /in/dL38t on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: gmp_init() in /in/dL38t on line 2