3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $objs = json_decode('"obj":{"a":{"key":"a", "value":2, "index":1}, "b":{"key":"b", "value":3, "index":2}}', true); var_dump($objs); $objs = array_column($objs, null, "key"); $objs['a']['value'] = 5; var_dump($objs);
based on dO77K
Output for 5.6.38 - 7.3.0rc3
NULL Warning: array_column() expects parameter 1 to be array, null given in /in/W3eQ9 on line 5 array(1) { ["a"]=> array(1) { ["value"]=> int(5) } }