3v4l.org

run code in 500+ PHP versions simultaneously
<?php // more than 18 is sufficient $json = '12345123451234512345'; var_dump(json_decode($json)); // a float var_dump(json_decode($json, flags: JSON_BIGINT_AS_STRING)); // a string var_dump(json_encode(json_decode($json, flags: JSON_BIGINT_AS_STRING))); // string(22) ""12345123451234512345"" // with extra ""
Output for 8.2.34, 8.3.0 - 8.3.35, 8.4.1 - 8.4.26, 8.5.0 - 8.5.11
float(1.2345123451234513E+19) string(20) "12345123451234512345" string(22) ""12345123451234512345""

preferences:
28.85 ms | 1152 KiB | 7 Q