3v4l.org

run code in 300+ PHP versions simultaneously
<?php function delta() { static $lastmem; $delta = memory_get_peak_usage() - $lastmem; if ($lastmem == 0) $delta = 0; $lastmem = memory_get_peak_usage(); return $delta; } $a=range(1, 500); for($x=0;$x<sizeof($a);$x++) { $a[$x]++; } var_dump('for loop and increment delta:'.delta()); foreach($a as $k=>$v) { $a[$k]++; } var_dump('foreach loop and increment delta: '.delta());
Output for git.master, git.master_jit, rfc.property-hooks
string(30) "for loop and increment delta:0" string(35) "foreach loop and increment delta: 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:
42.04 ms | 401 KiB | 8 Q