3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $cur; $arr = array('apple', 'orange', 'banana', 'potato', 'cocos', 'lime'); var_dump(current($arr)); next($arr); next($arr); next($arr); next($arr); next($arr); $arr = array('apple1', 'orange1', 'banana1', 'potato1', 'cocos1', 'lime1'); unset($arr[key($arr)]); var_dump($arr);
Output for 5.1.0 - 5.6.28, 7.0.0 - 7.1.0
string(5) "apple" array(5) { [1]=> string(7) "orange1" [2]=> string(7) "banana1" [3]=> string(7) "potato1" [4]=> string(6) "cocos1" [5]=> string(5) "lime1" }
Output for 5.0.4 - 5.0.5, hhvm-3.12.0
Notice: Undefined variable: cur in /in/ndmGI on line 3 string(5) "apple" array(5) { [1]=> string(7) "orange1" [2]=> string(7) "banana1" [3]=> string(7) "potato1" [4]=> string(6) "cocos1" [5]=> string(5) "lime1" }
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: cur in /in/ndmGI on line 3 string(5) "apple" array(5) { [1]=> string(7) "orange1" [2]=> string(7) "banana1" [3]=> string(7) "potato1" [4]=> string(6) "cocos1" [5]=> string(5) "lime1" }