3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = json_decode('[bar'); // many lines of code. $bar = json_encode('Hello world!', JSON_THROW_ON_ERROR); if (json_last_error() !== JSON_ERROR_NONE) { throw new Exception("encoding went wrong!"); } echo "All is fine";

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
153.49 ms | 2349 KiB | 13 Q