3v4l.org

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