3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data = "[]"; if (is_string($data)) { $res = json_decode($data, true); if ($res == NULL) { $res = $data; } } echo $res;
based on PlVGb
Output for 5.6.38 - 7.3.0rc3
[]