3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fruit = array('a' => 'apple', 'b' => 'banana', 'c' => 'cranberry'); reset($fruit); while (list($key, $val) = each($fruit)) { echo "$key => $val\n"; } echo '-----------------',PHP_EOL; foreach( $fruit as $key => $val ) { echo "$key => $val\n"; }

preferences:
80.36 ms | 404 KiB | 5 Q