3v4l.org

run code in 300+ PHP versions simultaneously
<?php function benchmarkMemory(callable $function, $args=null) { $memory = memory_get_peak_usage(); $result = is_array($args)? call_user_func_array($function, $args): call_user_func_array($function); return [ 'memory' => memory_get_peak_usage() - $memory ]; } var_dump(benchmarkMemory('str_repeat', ['test',1E4])); gc_collect_cycles(); var_dump(benchmarkMemory('str_repeat', ['test',1E3]));
Output for git.master, rfc.property-hooks
array(1) { ["memory"]=> int(4056) } array(1) { ["memory"]=> int(0) }
Output for git.master_jit
array(1) { ["memory"]=> int(4360) } array(1) { ["memory"]=> int(0) }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
45.95 ms | 406 KiB | 5 Q