3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = [['Id' => 1], ['As' => 2], ['Id' => 4], 'el']; array_walk($arr, function($v, $k) use ($arr) { if (!is_array($v) || empty($v['Id'])) { unset ($arr[$k]); } // echo $i .' '.$j.PHP_EOL; }); print_r($arr);
based on cHYUM
Output for 5.4.2 - 7.2.0
Array ( [0] => Array ( [Id] => 1 ) [1] => Array ( [As] => 2 ) [2] => Array ( [Id] => 4 ) [3] => el )
Output for 5.3.17 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/XQYEf on line 3
Process exited with code 255.