3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = gmp_init(PHP_INT_MAX); $value = ($value * 100000) + 1000; echo "value is " . $value . "\n"; ini_set('precision', -1); for ($i=1; $i < 20; $i += 1) { printf("%2d : test = %f %d \n", $i, (PHP_INT_MAX * 100000) + ($i * 500000), $i * 500000); }
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.32, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
value is 922337203685477580701000 1 : test = 922337203685477580800000.000000 500000 2 : test = 922337203685477580800000.000000 1000000 3 : test = 922337203685477580800000.000000 1500000 4 : test = 922337203685477580800000.000000 2000000 5 : test = 922337203685477580800000.000000 2500000 6 : test = 922337203685477580800000.000000 3000000 7 : test = 922337203685477580800000.000000 3500000 8 : test = 922337203685477580800000.000000 4000000 9 : test = 922337203685477580800000.000000 4500000 10 : test = 922337203685477580800000.000000 5000000 11 : test = 922337203685477580800000.000000 5500000 12 : test = 922337203685477580800000.000000 6000000 13 : test = 922337203685477580800000.000000 6500000 14 : test = 922337203685477580800000.000000 7000000 15 : test = 922337203685477580800000.000000 7500000 16 : test = 922337203685477580800000.000000 8000000 17 : test = 922337203685477580800000.000000 8500000 18 : test = 922337203685477580800000.000000 9000000 19 : test = 922337203685477580800000.000000 9500000
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 value is 922337203685477580701000 1 : test = 922337203685477580800000.000000 500000 2 : test = 922337203685477580800000.000000 1000000 3 : test = 922337203685477580800000.000000 1500000 4 : test = 922337203685477580800000.000000 2000000 5 : test = 922337203685477580800000.000000 2500000 6 : test = 922337203685477580800000.000000 3000000 7 : test = 922337203685477580800000.000000 3500000 8 : test = 922337203685477580800000.000000 4000000 9 : test = 922337203685477580800000.000000 4500000 10 : test = 922337203685477580800000.000000 5000000 11 : test = 922337203685477580800000.000000 5500000 12 : test = 922337203685477580800000.000000 6000000 13 : test = 922337203685477580800000.000000 6500000 14 : test = 922337203685477580800000.000000 7000000 15 : test = 922337203685477580800000.000000 7500000 16 : test = 922337203685477580800000.000000 8000000 17 : test = 922337203685477580800000.000000 8500000 18 : test = 922337203685477580800000.000000 9000000 19 : test = 922337203685477580800000.000000 9500000
Output for 7.4.33
Fatal error: Uncaught Error: Call to undefined function gmp_init() in /in/vhnVP:3 Stack trace: #0 {main} thrown in /in/vhnVP on line 3
Process exited with code 255.

preferences:
183.68 ms | 401 KiB | 156 Q