3v4l.org

run code in 300+ PHP versions simultaneously
<?php $list = array("A","B","C","D"); foreach ( $list as $var ) { print(current($list)); } echo "\n"; foreach ( $list as $var ) { print(item($list)); } function item($list) { return current($list); } echo "\n"; item2($list); function item2($list) { foreach ( $list as $var ) { print(current($list)); } } ?>

preferences:
31.36 ms | 404 KiB | 5 Q