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"); ?> ###### Then I wrote this function : <?php function myAbs(&$val){ $val = abs($val); } array_walk($values, "myAbs");
based on Wd7BC
Output for 5.3.0 - 7.2.0
Warning: abs() expects exactly 1 parameter, 2 given in /in/bAJoY on line 4 Warning: abs() expects exactly 1 parameter, 2 given in /in/bAJoY on line 4 Warning: abs() expects exactly 1 parameter, 2 given in /in/bAJoY on line 4 Warning: abs() expects exactly 1 parameter, 2 given in /in/bAJoY on line 4 Warning: abs() expects exactly 1 parameter, 2 given in /in/bAJoY on line 4 Warning: abs() expects exactly 1 parameter, 2 given in /in/bAJoY on line 4 Warning: abs() expects exactly 1 parameter, 2 given in /in/bAJoY on line 4 ###### Then I wrote this function :
Output for 4.3.0 - 5.2.17
Warning: Wrong parameter count for abs() in /in/bAJoY on line 4 Warning: Wrong parameter count for abs() in /in/bAJoY on line 4 Warning: Wrong parameter count for abs() in /in/bAJoY on line 4 Warning: Wrong parameter count for abs() in /in/bAJoY on line 4 Warning: Wrong parameter count for abs() in /in/bAJoY on line 4 Warning: Wrong parameter count for abs() in /in/bAJoY on line 4 Warning: Wrong parameter count for abs() in /in/bAJoY on line 4 ###### Then I wrote this function :