3v4l.org

run code in 300+ PHP versions simultaneously
<?php $path = ""; $finalArray = array(); $sourceArray = array( "bla.tif", "quux.tif", array("foo" => array("bar" => array("lorem" => array("ipsum.tif", "doler.tif")))), array("bar" => array("qux" => array("baz" => array("ipsum.tif", "ufo.tif"))))) ); foreach($sourceArray as $key => $value) { if(!is_array($value)) { $finalArray[] = $value; } else { $finalArray[] = recur($value, $path); } } print_r($finalArray); function recur($value, $path) { foreach($value as $idx => $subValue) { if(!is_array($subValue)) { return $path . "/" . $subValue; } else { return recur($value, $path); } } }

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.300.0030.04012.50
5.4.290.0040.04012.50
5.4.280.0050.03612.39
5.4.270.0030.03812.39
5.4.260.0050.04812.39
5.4.250.0110.04812.39
5.4.240.0080.04912.39
5.4.230.0120.04312.38
5.4.220.0040.04312.38
5.4.210.0100.04612.38
5.4.200.0090.04612.38
5.4.190.0060.03812.38
5.4.180.0040.04312.38
5.4.170.0070.05012.39
5.4.160.0060.03512.38
5.4.150.0040.03712.38
5.4.140.0060.03612.07
5.4.130.0020.04012.05
5.4.120.0080.03312.02
5.4.110.0070.03412.01
5.4.100.0050.03612.01
5.4.90.0080.04312.01
5.4.80.0090.04912.01
5.4.70.0100.03412.01
5.4.60.0100.04612.01
5.4.50.0070.03812.01
5.4.40.0060.03612.00
5.4.30.0060.04112.00
5.4.20.0070.04311.99
5.4.10.0060.04911.99
5.4.00.0070.04911.48
5.3.280.0080.05012.71
5.3.270.0040.05712.72
5.3.260.0130.03812.72
5.3.250.0090.05112.72
5.3.240.0110.04512.72
5.3.230.0070.04112.71
5.3.220.0160.04512.68
5.3.210.0070.04012.68
5.3.200.0040.04012.68
5.3.190.0040.04112.67
5.3.180.0120.04812.67
5.3.170.0110.03212.67
5.3.160.0050.03912.68
5.3.150.0060.04012.68
5.3.140.0080.03812.66
5.3.130.0050.04012.66
5.3.120.0060.04312.66
5.3.110.0110.04112.66
5.3.100.0070.03812.12
5.3.90.0120.03812.08
5.3.80.0050.04212.07
5.3.70.0030.03812.07
5.3.60.0040.03812.06
5.3.50.0070.03812.00
5.3.40.0120.03312.00
5.3.30.0050.03611.95
5.3.20.0090.03211.73
5.3.10.0090.03211.70
5.3.00.0050.03811.69

preferences:
139.29 ms | 1394 KiB | 7 Q