3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = range(0, 100000); $keys = array_map(function ($x) { return chr(46+rand(0, 26)) . chr(46+rand(0, 26)) . chr(46+rand(0, 26)) . $x; }, $x); $vars = array_combine($keys, $x); function _ext() { extract(func_get_args(0)); } function _for() { foreach (func_get_args(0) as $__k => $__v) { $$__k = $__v; } unset($__k, $__v); } $t = -microtime(TRUE); _ext($vars); echo sprintf("%.4f", $t + microtime(TRUE)); $t = -microtime(TRUE); _for($vars); echo sprintf("%.4f", $t + microtime(TRUE));

preferences:
31.48 ms | 416 KiB | 6 Q