3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array('a', 'b', 'c', 'd', null); for($i = 0; $i < count($a); $i += 2) { echo $i . " "; if (array_key_exists($i + 1, $a)) { echo $a[$i + 1] . " "; } echo ($i + 1) . PHP_EOL; } $n = explode('|', $n); var_dump($n);
based on HKkFS
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0rc3
0 b 1 2 d 3 4 5 Notice: Undefined variable: n in /in/DQbE3 on line 12 array(1) { [0]=> string(0) "" }
Output for hhvm-3.15.4
0 b 1 2 d 3 4 5 Notice: Undefined variable: n in /in/DQbE3 on line 12 Warning: explode() expects parameter 2 to be string, null given in /in/DQbE3 on line 12 NULL