3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array_fill(0, 100000, true); function is_indexed_foreach($array) { $n = 0; foreach ($array as $key => $_) { if ($key !== $n++) { return false; } } return true; } function is_indexed_range($array) { return array_keys($array) === range(0, count($array) - 1); } printf("%.2f mb\n", memory_get_peak_usage() / 1024 / 1024); is_indexed_foreach($array); printf("%.2f mb\n", memory_get_peak_usage() / 1024 / 1024); is_indexed_range($array); printf("%.2f mb\n", memory_get_peak_usage() / 1024 / 1024);
Output for git.master, rfc.property-hooks
2.38 mb 2.38 mb 6.38 mb
Output for git.master_jit
2.34 mb 2.34 mb 6.34 mb

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:
34.17 ms | 401 KiB | 8 Q