3v4l.org

run code in 300+ PHP versions simultaneously
<?php $val = ["12345", PHP_MAX_INT . "00"]; var_dump($val); echo "\n"; var_dump(json_encode($val)); echo "\n"; var_dump(json_encode($val, JSON_NUMERIC_CHECK));
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Undefined constant "PHP_MAX_INT" in /in/0Npf4:3 Stack trace: #0 {main} thrown in /in/0Npf4 on line 3
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
Warning: Use of undefined constant PHP_MAX_INT - assumed 'PHP_MAX_INT' (this will throw an Error in a future version of PHP) in /in/0Npf4 on line 3 array(2) { [0]=> string(5) "12345" [1]=> string(13) "PHP_MAX_INT00" } string(25) "["12345","PHP_MAX_INT00"]" string(23) "[12345,"PHP_MAX_INT00"]"
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20
Notice: Use of undefined constant PHP_MAX_INT - assumed 'PHP_MAX_INT' in /in/0Npf4 on line 3 array(2) { [0]=> string(5) "12345" [1]=> string(13) "PHP_MAX_INT00" } string(25) "["12345","PHP_MAX_INT00"]" string(23) "[12345,"PHP_MAX_INT00"]"

preferences:
186.57 ms | 403 KiB | 223 Q