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; }*/ for($k=0; $k<count($a); $k++){ if($k==1) unset($a[$k]); echo $k.' ('.$a[$k].')'.PHP_EOL; } print_r($a);
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
0 (a) Notice: Undefined offset: 1 in /in/v3in6 on line 15 1 () Array ( [0] => a [2] => c )
Output for hhvm-3.10.0 - 3.13.2
0 (a) Notice: Undefined index: 1 in /in/v3in6 on line 15 1 () Array ( [0] => a [2] => c )
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.2.17
0 (a) Notice: Undefined offset: 1 in /in/v3in6 on line 15 1 () 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/v3in6 on line 15 0 (a)PHP_EOL Notice: Undefined offset: 1 in /in/v3in6 on line 15 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/v3in6 on line 15 1 ()PHP_EOLArray ( [0] => a [2] => c )