3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $promos = [ '123' => ['id' => '123', 'weight' => 1], '234' => ['id' => '234', 'weight' => 3], '345' => ['id' => '345', 'weight' => 2], ]; var_dump(array_column($promos, 'weight', 'id'));
Output for 5.6.30
array(3) { [123]=> int(1) [234]=> int(3) [345]=> int(2) }