3v4l.org

run code in 300+ PHP versions simultaneously
<?php $badValue = array( 'key1' => array( 'irrelevant' => array('nothere'), 'key2' => array( 'goodString' => 'OK', 'badString' => "\xc3\x28foo" ) ) ); $enc = json_encode($badValue); print_r(array('enc' => $enc, 'json_last_error' => json_last_error())); echo "\nafter";

preferences:
40.16 ms | 402 KiB | 5 Q