3v4l.org

run code in 300+ PHP versions simultaneously
<?php $example = [ ['text' => 'a', 'children' => [ ['text' => 'b'], ['text' => 'c'], ['text' => 'd', 'children' => [ ['text' => 'e'], ['text' => 'f'], ['text' => 'g', 'children' => [ ['text' => 'h'], ['text' => 'i'], ['text' => 'j'], ]], ['text' => 'k'], ['text' => 'l'], ['text' => 'm'], ]], ['text' => 'n'], ['text' => 'o'], ['text' => 'p'], ]] ]; function listElements(array $input, $depth = 0) { end($input); $final = key($input); $n = count($input); foreach ($input as $key => $element) { echo $element['text']; echo ($key == $final) ? " last of $n," : ''; echo " depth $depth", PHP_EOL; if (isset($element['children'])) { listElements($element['children'], $depth + 1); } } } listElements($example);

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)
8.5.00.0120.01020.20
8.4.150.0020.00014.05
8.4.140.0150.00917.66
8.4.130.0130.00718.03
8.4.120.0140.00722.11
8.4.110.0070.00722.64
8.4.100.0080.01217.59
8.4.90.0100.00718.71
8.4.80.0090.00418.00
8.4.70.0050.00317.74
8.4.60.0080.01318.69
8.4.50.0130.01021.37
8.4.40.0060.00319.58
8.4.30.0060.00320.48
8.4.20.0130.00719.54
8.4.10.0120.00919.45
8.3.280.0120.00918.54
8.3.270.0160.00416.80
8.3.260.0090.01016.60
8.3.250.0070.00918.91
8.3.240.0110.00816.66
8.3.230.0060.01016.63
8.3.220.0100.00819.00
8.3.210.0140.00616.86
8.3.200.0050.00416.56
8.3.190.0120.00717.31
8.3.180.0110.00416.80
8.3.170.0030.00616.74
8.3.160.0140.00416.55
8.3.150.0070.00717.08
8.3.140.0060.00316.70
8.3.130.0060.01316.69
8.3.120.0030.00618.99
8.3.110.0040.00416.36
8.3.100.0050.00516.69
8.3.90.0040.00426.77
8.3.80.0050.00516.50
8.3.70.0090.00618.43
8.3.60.0150.00718.43
8.3.50.0080.00624.53
8.3.40.0070.01118.84
8.3.30.0070.00718.84
8.3.20.0060.00322.52
8.3.10.0050.00320.29
8.3.00.0090.00020.59
8.2.290.0070.00320.54
8.2.280.0120.00620.29
8.2.270.0090.00916.75
8.2.260.0090.01218.79
8.2.250.0080.00018.57
8.2.240.0060.00318.50
8.2.230.0030.00620.94
8.2.220.0040.00424.06
8.2.210.0030.00626.77
8.2.200.0060.00316.75
8.2.190.0120.00316.63
8.2.180.0160.00618.16
8.2.170.0120.00322.96
8.2.160.0060.00922.10
8.2.150.0000.00924.18
8.2.140.0030.00624.66
8.2.130.0040.00426.16
8.2.120.0050.00321.01
8.2.110.0070.00320.25
8.2.100.0060.00617.91
8.2.90.0070.00317.84
8.2.80.0030.00519.35
8.2.70.0060.00317.75
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0000.01118.35
8.2.30.0040.00418.21
8.2.20.0040.00418.14
8.2.10.0040.00418.95
8.2.00.0000.00719.21
8.1.330.0120.00720.36
8.1.320.0150.00416.28
8.1.310.0060.00318.45
8.1.300.0110.00416.09
8.1.290.0040.00730.84
8.1.280.0090.00625.92
8.1.270.0100.00722.13
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0090.00022.45
8.1.230.0040.00720.84
8.1.220.0060.00317.74
8.1.210.0090.00018.83
8.1.200.0030.00617.35
8.1.190.0060.00317.35
8.1.180.0040.00418.10
8.1.170.0050.00318.59
8.1.160.0000.00718.98
8.1.150.0020.00518.83
8.1.140.0000.00918.96
8.1.130.0030.00320.10
8.1.120.0040.00417.50
8.1.110.0080.00017.45
8.1.100.0000.00817.51
8.1.90.0000.00717.50
8.1.80.0100.00017.48
8.1.70.0000.00717.48
8.1.60.0000.00817.60
8.1.50.0050.00317.45
8.1.40.0090.00017.45
8.1.30.0030.00617.65
8.1.20.0080.00017.69
8.1.10.0000.00817.62
8.1.00.0060.00317.55
8.0.300.0040.00420.02
8.0.290.0000.00716.63
8.0.280.0040.00418.47
8.0.270.0000.00717.37
8.0.260.0030.00320.06
8.0.250.0000.00716.86
8.0.240.0000.00716.90
8.0.230.0030.00317.04
8.0.220.0030.00316.91
8.0.210.0040.00416.92
8.0.200.0030.00316.97
8.0.190.0070.00016.96
8.0.180.0040.00416.85
8.0.170.0060.00316.91
8.0.160.0000.00716.96
8.0.150.0050.00216.74
8.0.140.0030.00616.91
8.0.130.0000.00713.30
8.0.120.0000.00916.93
8.0.110.0000.00816.94
8.0.100.0070.00017.03
8.0.90.0000.00916.87
8.0.80.0160.00016.85
8.0.70.0040.00416.89
8.0.60.0040.00416.88
8.0.50.0000.00716.77
8.0.30.0110.00816.81
8.0.20.0180.01117.10
8.0.10.0070.00017.00
8.0.00.0160.00616.60
7.4.330.0030.00315.55
7.4.320.0030.00316.68
7.4.300.0060.00016.59
7.4.290.0060.00316.63
7.4.280.0050.00316.51
7.4.270.0050.00316.55
7.4.260.0000.00613.28
7.4.250.0040.00416.50
7.4.240.0000.00816.52
7.4.230.0000.00716.52
7.4.220.0050.00216.37
7.4.210.0090.00816.57
7.4.200.0040.00416.41
7.4.130.0050.01416.54
7.4.120.0100.01016.41
7.4.110.0180.00016.68
7.4.100.0090.00916.58
7.4.90.0090.01216.57
7.4.80.0130.01019.39
7.4.70.0040.01216.49
7.4.60.0170.01016.43
7.4.50.0030.01316.52
7.4.40.0030.01316.59
7.4.00.0030.01215.10
7.3.330.0030.00316.41
7.3.320.0020.00313.34
7.3.310.0030.00316.26
7.3.300.0070.00016.27
7.3.290.0070.00016.39
7.3.280.0080.00816.37
7.3.260.0090.00916.51
7.3.230.0080.01216.43
7.3.210.0100.00716.73
7.3.200.0100.00716.44
7.3.190.0030.01316.27
7.3.180.0130.00316.71
7.3.170.0060.01116.58
7.3.160.0040.01216.65
7.3.120.0030.01614.93
7.3.110.0080.00814.76
7.3.100.0070.01314.80
7.3.90.0130.00614.54
7.3.80.0060.00915.03
7.3.70.0110.00814.80
7.3.60.0070.00714.78
7.3.50.0100.00914.95
7.3.40.0080.00814.71
7.3.30.0040.01114.77
7.3.20.0070.01014.81
7.3.10.0080.01214.71
7.3.00.0080.00714.68
7.2.330.0170.00316.45
7.2.320.0140.00616.73
7.2.310.0210.00316.75
7.2.300.0060.01216.50
7.2.290.0100.00616.55
7.2.240.0030.01615.05
7.2.230.0110.00515.01
7.2.220.0110.00814.65
7.2.210.0110.00314.90
7.2.200.0100.00615.20
7.2.190.0030.01414.90
7.2.180.0060.01315.13
7.2.170.0060.01014.99
7.2.160.0090.00615.02
7.2.150.0160.00515.22
7.2.140.0080.01215.12
7.2.130.0120.00615.09
7.2.120.0170.00315.12
7.2.110.0090.01215.09
7.2.100.0100.01014.99
7.2.90.0170.00015.32
7.2.80.0090.00915.11
7.2.70.0150.00315.11
7.2.60.0150.00615.11
7.2.50.0100.01015.09
7.2.40.0060.01215.04
7.2.30.0070.01015.14
7.2.20.0100.00715.00
7.2.10.0030.01215.12
7.2.00.0060.00914.86
7.1.330.0030.01714.08
7.1.320.0040.01213.90
7.1.310.0100.00313.92
7.1.300.0110.00713.97
7.1.290.0080.00813.91
7.1.280.0050.01514.10
7.1.270.0070.00714.18
7.1.260.0030.01313.75
7.1.250.0080.00814.00

preferences:
32.28 ms | 403 KiB | 5 Q