3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $users = array_fill(0, 10000, 'name'); function userNames($users) { foreach($users as $user) { yield $user; } } $start = microtime(true) . PHP_EOL; foreach(userNames($users) as $name) { echo $name . PHP_EOL; } echo microtime(true) - $start; unset($start); echo str_repeat(PHP_EOL, 2); $start = microtime(true) . PHP_EOL; foreach($users as $name) { echo $name . PHP_EOL; } echo microtime(true) - $start;

Verbose script

This script was stopped because it was generating too much output