3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array('cifras'=>array(array('ordem'=>1),array('ordem'=>2),array('ordem'=>3))); function abc($item, $key) { echo "$key holds $item\n"; } array_walk($a,abc); var_dump($a);
Output for 5.4.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Use of undefined constant abc - assumed 'abc' in /in/eD2L4 on line 7 Notice: Array to string conversion in /in/eD2L4 on line 5 cifras holds Array array(1) { ["cifras"]=> array(3) { [0]=> array(1) { ["ordem"]=> int(1) } [1]=> array(1) { ["ordem"]=> int(2) } [2]=> array(1) { ["ordem"]=> int(3) } } }
Output for 4.3.0 - 5.3.29
Notice: Use of undefined constant abc - assumed 'abc' in /in/eD2L4 on line 7 cifras holds Array array(1) { ["cifras"]=> array(3) { [0]=> array(1) { ["ordem"]=> int(1) } [1]=> array(1) { ["ordem"]=> int(2) } [2]=> array(1) { ["ordem"]=> int(3) } } }