3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $values = array(-5,2,3,-8,4,-1,0); array_walk($values, "abs"); ?> function myAbs(&$val){ $val = abs($val); } array_walk($values, "myAbs");
based on bAJoY
Output for 5.3.0 - 7.2.0
Warning: abs() expects exactly 1 parameter, 2 given in /in/qto2V on line 4 Warning: abs() expects exactly 1 parameter, 2 given in /in/qto2V on line 4 Warning: abs() expects exactly 1 parameter, 2 given in /in/qto2V on line 4 Warning: abs() expects exactly 1 parameter, 2 given in /in/qto2V on line 4 Warning: abs() expects exactly 1 parameter, 2 given in /in/qto2V on line 4 Warning: abs() expects exactly 1 parameter, 2 given in /in/qto2V on line 4 Warning: abs() expects exactly 1 parameter, 2 given in /in/qto2V on line 4 function myAbs(&$val){ $val = abs($val); } array_walk($values, "myAbs");
Output for 4.3.0 - 5.2.17
Warning: Wrong parameter count for abs() in /in/qto2V on line 4 Warning: Wrong parameter count for abs() in /in/qto2V on line 4 Warning: Wrong parameter count for abs() in /in/qto2V on line 4 Warning: Wrong parameter count for abs() in /in/qto2V on line 4 Warning: Wrong parameter count for abs() in /in/qto2V on line 4 Warning: Wrong parameter count for abs() in /in/qto2V on line 4 Warning: Wrong parameter count for abs() in /in/qto2V on line 4 function myAbs(&$val){ $val = abs($val); } array_walk($values, "myAbs");