3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array(1,2,3,4,5,6,7,8,9); function soma_1($chave, $valor){ $array[$chave] += 1; } function echo_array($chave){ echo "$chave \n"; } array_walk($array,'soma_1'); array_walk($array,'echo_array');
based on P70bY
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 1 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 2 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 3 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 4 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 5 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 6 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 7 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 8 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 9 in /in/da0ok on line 6 1 2 3 4 5 6 7 8 9
Output for hhvm-3.10.0 - 3.12.0
1 2 3 4 5 6 7 8 9
Output for 5.1.0 - 5.2.17
Notice: Undefined offset: 1 in /in/da0ok on line 6 Notice: Undefined offset: 2 in /in/da0ok on line 6 Notice: Undefined offset: 3 in /in/da0ok on line 6 Notice: Undefined offset: 4 in /in/da0ok on line 6 Notice: Undefined offset: 5 in /in/da0ok on line 6 Notice: Undefined offset: 6 in /in/da0ok on line 6 Notice: Undefined offset: 7 in /in/da0ok on line 6 Notice: Undefined offset: 8 in /in/da0ok on line 6 Notice: Undefined offset: 9 in /in/da0ok on line 6 1 2 3 4 5 6 7 8 9
Output for 5.0.4 - 5.0.5
Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 1 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 2 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 3 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 4 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 5 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 6 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 7 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 8 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 9 in /in/da0ok on line 6 1 2 3 4 5 6 7 8 9
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 1 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 2 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 3 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 4 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 5 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 6 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 7 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 8 in /in/da0ok on line 6 Notice: Undefined variable: array in /in/da0ok on line 6 Notice: Undefined offset: 9 in /in/da0ok on line 6 1 2 3 4 5 6 7 8 9