3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function square(&$n) { if(is_numeric($n)) $n = ($n * $n); } $array = array(0, 48, 22, 90, 44, 9, 222, 'Iamzheasshole', 101); array_walk($array, 'square'); print_r($array);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => 0 [1] => 2304 [2] => 484 [3] => 8100 [4] => 1936 [5] => 81 [6] => 49284 [7] => Iamzheasshole [8] => 10201 )