3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isJson($string) { $decoded = json_decode($string); return (json_last_error() == JSON_ERROR_NONE); } if ( isJson("hello") ) { echo "valid JSON"; } else { echo "not valid JSON"; }

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
153.05 ms | 2292 KiB | 11 Q