3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{"\u0000": true}'; var_dump(json_decode($json, true), json_last_error_msg()); var_dump(json_decode($json), json_last_error_msg());
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
array(1) { [""]=> bool(true) } string(8) "No error" NULL string(36) "The decoded property name is invalid"
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
array(1) { [""]=> bool(true) } string(8) "No error" Fatal error: Cannot access property started with '\0' in /in/mdKIe on line 6
Process exited with code 255.

preferences:
104.58 ms | 1505 KiB | 4 Q