3v4l.org

run code in 300+ PHP versions simultaneously
<?php function benchmark($function, $args=null, $count=1) { $time = microtime(1); for($i=0; $i<$count; $i++) { $result = is_array($args)? call_user_func_array($function, $args): call_user_func_array($function); } return array( 'total_time' => microtime(1) - $time, 'average_time' => (microtime(1) - $time)/$count, 'count' => $count ); } function p($string) { print_r($string . "<br>"); } var_dump(benchmark('p', array('test',1E4))); gc_collect_cycles(); //var_dump(benchmark('p', array('test',1E3)));

preferences:
39.84 ms | 402 KiB | 5 Q