3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myArray = array( "a", array( "a", "b", array( "a", "b", "c", array( "a", "b", "c", "d", array("the end") ) ) ) ); $recursive_array_iterator = new RecursiveArrayIterator(&$myArray); iterator_apply(&$recursive_array_iterator, 'traverseRecursiveArray', array(&$recursive_array_iterator)); function traverseRecursiveArray($iterator) { while ($iterator->valid()) { if ($iterator->hasChildren()) { traverseRecursiveArray($iterator->getChildren()); } else { $iterator->offsetSet($iterator->key(), manipulate($iterator->current())); echo $iterator->key() . ' => ' . $iterator->current() . PHP_EOL; } $iterator->next(); } } function manipulate($string) { $string .= " appended"; return $string; } var_dump($myArray);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.310.0080.04112.46
5.4.300.0080.04412.46
5.4.290.0090.03812.46
5.4.280.0060.03512.36
5.4.270.0100.03712.36
5.4.260.0050.03912.36
5.4.250.0050.04012.36
5.4.240.0090.03512.36
5.4.230.0050.03912.35
5.4.220.0060.03612.35
5.4.210.0070.04212.35
5.4.200.0110.04712.35
5.4.190.0110.03612.34
5.4.180.0040.03912.35
5.4.170.0090.03312.36
5.4.160.0040.03712.35
5.4.150.0090.03212.35
5.4.140.0080.03712.04
5.4.130.0060.03512.02
5.4.120.0050.03611.98
5.4.110.0040.03711.98
5.4.100.0080.03711.97
5.4.90.0070.03611.97
5.4.80.0070.04011.98
5.4.70.0080.03211.97
5.4.60.0060.03611.97
5.4.50.0070.03411.98
5.4.40.0060.03511.96
5.4.30.0070.03611.95
5.4.20.0100.03211.95
5.4.10.0040.03611.96
5.4.00.0070.03511.45
5.3.290.0070.04112.80
5.3.280.0080.03712.71
5.3.270.0100.03712.72
5.3.260.0080.03812.72
5.3.250.0100.03512.72
5.3.240.0090.04912.72
5.3.230.0060.04112.71
5.3.220.0070.03712.68
5.3.210.0080.04612.68
5.3.200.0060.03712.68
5.3.190.0080.03512.68
5.3.180.0060.03612.67
5.3.170.0070.03712.67
5.3.160.0070.03612.67
5.3.150.0060.03912.67
5.3.140.0060.03812.66
5.3.130.0060.03812.66
5.3.120.0060.03912.65
5.3.110.0080.03712.66
5.3.100.0090.04012.13
5.3.90.0050.03812.11
5.3.80.0050.03812.10
5.3.70.0080.03412.10
5.3.60.0060.03812.08
5.3.50.0050.03812.03
5.3.40.0060.03712.03
5.3.30.0040.03811.99
5.3.20.0080.03311.77
5.3.10.0080.04211.74
5.3.00.0050.04911.72

preferences:
140.11 ms | 1386 KiB | 7 Q