3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $json = new stdClass; $arr = []; $arr[0] = "abc"; $arr[1] = "aaa"; $str = 'foo'; $abc = 'bar'; $json->$arr[0] = $arr[1]; echo json_encode($json);
based on tNkdb
Output for 7.0.0 - 7.2.0
Notice: Array to string conversion in /in/DXNni on line 8 {"Array":["aaa"]}
Output for 5.5.0 - 5.6.28
{"abc":"aaa"}