3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $foo = array(1,94,82,2,0,38,12,5); $bar = array_map(function($x) { return (5+$x); }, $foo); var_dump(4/0); var_dump($bar); var_dump(sort($bar)); var_dump($bar);
based on v9s1U
Output for 7.0.0 - 7.2.0
Warning: Division by zero in /in/ttnDi on line 5 float(INF) array(8) { [0]=> int(6) [1]=> int(99) [2]=> int(87) [3]=> int(7) [4]=> int(5) [5]=> int(43) [6]=> int(17) [7]=> int(10) } bool(true) array(8) { [0]=> int(5) [1]=> int(6) [2]=> int(7) [3]=> int(10) [4]=> int(17) [5]=> int(43) [6]=> int(87) [7]=> int(99) }
Output for 5.3.21 - 5.6.28
Warning: Division by zero in /in/ttnDi on line 5 bool(false) array(8) { [0]=> int(6) [1]=> int(99) [2]=> int(87) [3]=> int(7) [4]=> int(5) [5]=> int(43) [6]=> int(17) [7]=> int(10) } bool(true) array(8) { [0]=> int(5) [1]=> int(6) [2]=> int(7) [3]=> int(10) [4]=> int(17) [5]=> int(43) [6]=> int(87) [7]=> int(99) }