3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array('a', 'b', 'c'); foreach($a as $k=>$v){ if($k==1) unset($a[$k]); echo $k.' => '.$v.' ('.$a[$k].')'.PHP_EOL; } print_r($a);
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
0 => a (a) Notice: Undefined offset: 1 in /in/cvLr0 on line 9 1 => b () 2 => c (c) Array ( [0] => a [2] => c )
Output for hhvm-3.12.0
0 => a (a) Notice: Undefined index: 1 in /in/cvLr0 on line 9 1 => b () 2 => c (c) Array ( [0] => a [2] => c )
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.2.17
0 => a (a) Notice: Undefined offset: 1 in /in/cvLr0 on line 9 1 => b () 2 => c (c) Array ( [0] => a [2] => c )
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/cvLr0 on line 9 0 => a (a)PHP_EOL Notice: Undefined offset: 1 in /in/cvLr0 on line 9 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/cvLr0 on line 9 1 => b ()PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/cvLr0 on line 9 2 => c (c)PHP_EOLArray ( [0] => a [2] => c )