3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $fruits = array("d" => "lemon", "a" => "orange", "b" => "banana", "c" => "apple"); function test_alter(&$item1, $key, $prefix) { $item1 = "$prefix: $item1"; } function test_print($item2, $key) { echo "$$key = $item2<br />\n"; } echo "Before ...:\n"; array_walk($fruits, 'test_print'); ?>
based on YAV69
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Before ...: $d = lemon<br /> $a = orange<br /> $b = banana<br /> $c = apple<br />