3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array(); $a[] = array('a' => 1); $a[] = array('a' => 2); $a[] = array('a' => 3); $column = 'a'; $res = array_map(function ($item) use ($column) {return is_object($item) ? $item->{$column} : $item[$column]; }, $a); var_dump($res);
based on iCRVp
Output for 5.3.18 - 7.3.0beta1
array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) }