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.2.35, 8.3.0 - 8.3.36, 8.4.1 - 8.4.27, 8.5.0 - 8.5.12
float(1.2345123451234513E+19) string(20) "12345123451234512345" string(22) ""12345123451234512345""

preferences:
24.3 ms | 1159 KiB | 6 Q