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.' => '.$v.' ('.$a[$k].')'.PHP_EOL; } print_r($a);
Output for 5.3.0 - 7.1.0
Notice: Undefined variable: v in /in/MZO8n on line 15 0 => (a) Notice: Undefined variable: v in /in/MZO8n on line 15 Notice: Undefined offset: 1 in /in/MZO8n on line 15 1 => () Array ( [0] => a [2] => c )
Output for 5.0.4 - 5.2.17
Notice: Undefined variable: v in /in/MZO8n on line 15 0 => (a) Notice: Undefined variable: v in /in/MZO8n on line 15 Notice: Undefined offset: 1 in /in/MZO8n on line 15 1 => () Array ( [0] => a [2] => c )
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.0.3
Notice: Undefined variable: v in /in/MZO8n on line 15 0 => (a) Notice: Undefined variable: v in /in/MZO8n on line 15 Notice: Undefined offset: 1 in /in/MZO8n on line 15 1 => () Array ( [0] => a [2] => c )
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Undefined variable: v in /in/MZO8n on line 15 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/MZO8n on line 15 0 => (a)PHP_EOL Notice: Undefined variable: v in /in/MZO8n on line 15 Notice: Undefined offset: 1 in /in/MZO8n on line 15 Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/MZO8n on line 15 1 => ()PHP_EOLArray ( [0] => a [2] => c )