3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = ["foo", "bar", "baz"]; for(reset($arr); list($k, $v) = each($arr);){ echo "$k => $v"; } echo "\n---\n"; foreach($arr as $k => $v){ echo "$k => $v"; }
Output for 7.2.0
Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /in/WKheK on line 5 0 => foo1 => bar2 => baz --- 0 => foo1 => bar2 => baz
Output for 5.4.12 - 7.1.10
0 => foo1 => bar2 => baz --- 0 => foo1 => bar2 => baz
Output for 5.3.22 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/WKheK on line 3
Process exited with code 255.