3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cards = [ [ "from" => "Barcelona", "to" => "Gerona Airport", ], [ "from" => "Stockholm", "to" => "New York JFK", ], [ "from" => "Gerona Airport", "to" => "Stockholm", ], [ "from" => "New York JFK", "to" => "Amsterdam", ], [ "from" => "Amsterdam", "to" => "London", ], [ "from" => "Madrid", "to" => "Barcelona", ] ]; $result = []; function doSort($cards, &$result, $start = "Madrid") { foreach ($cards as $key => $card) { if ($card["from"] === $start) { $result[] = $card; doSort($cards, $result, $card["to"]); } } } doSort($cards, $result); print_r($result);

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.4.120.0110.00924.08
8.4.110.0160.00318.96
8.4.100.0130.00718.91
8.4.90.0070.01120.71
8.4.80.0090.00418.89
8.4.70.0070.00318.08
8.4.60.0130.00819.05
8.4.50.0050.01020.70
8.4.40.0100.00719.60
8.4.30.0160.00317.83
8.4.20.0130.00319.66
8.4.10.0060.00319.43
8.3.250.0100.00816.50
8.3.240.0080.00516.99
8.3.230.0130.00718.57
8.3.220.0120.00618.80
8.3.210.0070.01016.54
8.3.200.0050.00416.85
8.3.190.0090.00417.35
8.3.180.0080.01016.79
8.3.170.0100.00017.03
8.3.160.0180.00016.81
8.3.150.0160.00320.61
8.3.140.0030.00618.96
8.3.130.0060.00318.49
8.3.120.0030.00620.74
8.3.110.0040.00420.94
8.3.100.0060.00324.06
8.3.90.0030.00526.77
8.3.80.0030.00618.68
8.3.70.0120.00616.61
8.3.60.0140.00716.62
8.3.50.0090.00518.31
8.3.40.0060.01018.84
8.3.30.0070.00718.89
8.3.20.0040.00421.77
8.3.10.0080.00023.48
8.3.00.0000.00819.81
8.2.290.0060.00420.55
8.2.280.0070.01118.14
8.2.270.0120.00817.39
8.2.260.0040.00418.41
8.2.250.0100.00016.44
8.2.240.0070.00417.49
8.2.230.0060.00322.58
8.2.220.0130.00637.54
8.2.210.0040.00426.77
8.2.200.0060.00318.88
8.2.190.0140.00716.58
8.2.180.0140.00716.38
8.2.170.0120.00322.96
8.2.160.0110.00322.13
8.2.150.0000.00724.18
8.2.140.0040.00424.66
8.2.130.0040.00421.07
8.2.120.0040.00426.35
8.2.110.0030.00620.53
8.2.100.0110.00017.91
8.2.90.0040.00419.48
8.2.80.0080.00020.41
8.2.70.0040.00617.75
8.2.60.0030.00517.63
8.2.50.0040.00417.55
8.2.40.0040.00419.48
8.2.30.0040.00419.45
8.2.20.0020.00518.09
8.2.10.0000.00818.03
8.2.00.0000.00718.09
8.1.330.0140.00522.11
8.1.320.0110.00816.16
8.1.310.0090.00618.62
8.1.300.0060.00318.45
8.1.290.0040.00430.84
8.1.280.0140.00725.92
8.1.270.0040.00422.05
8.1.260.0070.00026.35
8.1.250.0050.00328.09
8.1.240.0140.00321.94
8.1.230.0040.00724.05
8.1.220.0000.00817.77
8.1.210.0080.00018.98
8.1.200.0030.00617.35
8.1.190.0040.00417.22
8.1.180.0030.00618.10
8.1.170.0030.00619.02
8.1.160.0040.00418.90
8.1.150.0000.00720.20
8.1.140.0090.00017.72
8.1.130.0040.00417.56
8.1.120.0070.00017.48
8.1.110.0000.00817.47
8.1.100.0000.00917.36
8.1.90.0000.00817.50
8.1.80.0020.00517.40
8.1.70.0030.00317.47
8.1.60.0040.00417.65
8.1.50.0070.00317.51
8.1.40.0030.00617.45
8.1.30.0000.00817.56
8.1.20.0030.00617.52
8.1.10.0040.00417.64
8.1.00.0070.00017.57
8.0.300.0000.00720.08
8.0.290.0060.00316.75
8.0.280.0050.00318.49
8.0.270.0030.00617.33
8.0.260.0000.00716.84
8.0.250.0030.00316.85
8.0.240.0060.00316.93
8.0.230.0090.00017.00
8.0.220.0000.00716.84
8.0.210.0000.00716.93
8.0.200.0030.00316.98
8.0.190.0080.00017.01
8.0.180.0000.00816.82
8.0.170.0040.00416.93
8.0.160.0040.00416.87
8.0.150.0000.00716.74
8.0.140.0040.00416.88
8.0.130.0000.00613.30
8.0.120.0000.00716.88
8.0.110.0000.00716.94
8.0.100.0050.00216.89
8.0.90.0040.00416.94
8.0.80.0060.01216.88
8.0.70.0000.00716.82
8.0.60.0040.00416.74
8.0.50.0040.00416.74
8.0.30.0080.01117.07
8.0.20.0080.01517.40
8.0.10.0050.00217.00
8.0.00.0150.00716.63
7.4.330.0020.00215.55
7.4.320.0030.00316.65
7.4.300.0060.00316.61
7.4.290.0030.00316.42
7.4.280.0040.00416.57
7.4.270.0000.00716.54
7.4.260.0030.00316.43
7.4.250.0000.00716.50
7.4.240.0030.00316.58
7.4.230.0040.00416.38
7.4.220.0040.00416.43
7.4.210.0090.00516.62
7.4.200.0030.00316.51
7.4.160.0110.00616.47
7.4.140.0120.00717.86
7.4.130.0170.00716.51
7.4.120.0140.00616.55
7.4.110.0030.01316.62
7.4.100.0120.00916.65
7.4.90.0190.00316.44
7.4.80.0100.01319.39
7.4.70.0100.00616.41
7.4.60.0030.01216.49
7.4.50.0080.00516.41
7.4.40.0030.01316.38
7.4.10.0060.01314.86
7.4.00.0100.00715.01
7.3.330.0050.00013.16
7.3.320.0060.00013.23
7.3.310.0000.00716.39
7.3.300.0020.00516.25
7.3.290.0000.00716.34
7.3.280.0070.00816.35
7.3.260.0120.00916.45
7.3.240.0090.00916.52
7.3.230.0070.01116.32
7.3.210.0050.01116.36
7.3.200.0180.00016.47
7.3.190.0070.01016.46
7.3.180.0160.00016.65
7.3.170.0080.00816.48
7.3.160.0070.01016.40
7.3.130.0070.01114.93
7.3.120.0070.01015.00
7.3.110.0060.01215.16
7.3.100.0070.01014.58
7.3.90.0080.00614.83
7.3.80.0040.01114.90
7.3.70.0040.01114.79
7.3.60.0090.00314.63
7.3.50.0080.00414.71
7.3.40.0070.01014.99
7.3.30.0030.01415.00
7.3.20.0090.00616.73
7.3.10.0060.01016.38
7.3.00.0030.00916.51
7.2.330.0060.01216.63
7.2.320.0130.00916.64
7.2.310.0060.01216.69
7.2.300.0030.01316.73
7.2.290.0070.01116.77
7.2.260.0030.01314.92
7.2.250.0030.01215.09
7.2.240.0060.00915.03
7.2.230.0100.00715.10
7.2.220.0000.01315.16
7.2.210.0030.01315.03
7.2.200.0000.01615.19
7.2.190.0060.00914.89
7.2.180.0090.00014.93
7.2.170.0040.01514.80
7.2.160.0090.00414.74
7.2.150.0050.00517.04
7.2.140.0150.00017.06
7.2.130.0060.00916.78
7.2.120.0120.00317.05
7.2.110.0080.00416.82
7.2.100.0080.00416.91
7.2.90.0030.01317.03
7.2.80.0120.00616.80
7.2.70.0070.01117.04
7.2.60.0080.01016.79
7.2.50.0030.01316.91
7.2.40.0100.00317.09
7.2.30.0030.01416.80
7.2.20.0130.00917.58
7.2.10.0310.01117.48
7.2.00.0110.01317.40
7.1.330.0090.00315.83
7.1.320.0030.01715.95
7.1.310.0000.01515.70
7.1.300.0100.00315.86
7.1.290.0060.00915.77
7.1.280.0000.01715.83
7.1.270.0080.00415.65
7.1.260.0030.00915.93
7.1.250.0090.00615.82
7.1.240.0110.00315.82
7.1.230.0080.00015.78
7.1.220.0000.00915.99
7.1.210.0030.01215.77
7.1.200.0080.00315.95
7.1.190.0070.00716.01
7.1.180.0170.00015.93
7.1.170.0100.00315.91
7.1.160.0030.00715.97
7.1.150.0130.00315.92
7.1.140.0080.01116.31
7.1.130.0100.01216.38
7.1.120.0090.01216.43
7.1.110.0150.00615.83
7.1.100.0090.00915.88
7.1.90.0130.00816.05
7.1.80.0120.00816.00
7.1.70.0140.01015.65
7.1.60.0170.01324.59
7.1.50.0250.00724.41
7.1.40.0200.00824.29
7.1.30.0180.01024.28
7.1.20.0160.01324.34
7.1.10.0100.00915.28
7.1.00.0090.01115.14
7.0.330.0040.00415.38
7.0.320.0110.00415.38
7.0.310.0040.01415.37
7.0.300.0030.00615.50
7.0.290.0080.00415.06
7.0.280.0130.00015.57
7.0.270.0030.01015.52
7.0.260.0070.01115.21
7.0.250.0070.00715.63
7.0.240.0030.01015.50
7.0.230.0070.00715.51
7.0.220.0030.01315.47
7.0.210.0090.00615.51
7.0.200.0090.00015.54
7.0.190.0030.01015.45
7.0.180.0000.01215.59
7.0.170.0040.01115.43
7.0.160.0090.00915.42
7.0.150.0080.00415.48
7.0.140.0100.00715.27
7.0.130.0000.01115.45
7.0.120.0070.00715.51
7.0.110.0090.00915.18
7.0.100.0090.00915.47
7.0.90.0060.01015.39
7.0.80.0040.01415.25
7.0.70.0000.01515.45
7.0.60.0070.00615.23
7.0.50.0060.00615.43
7.0.40.0030.01013.55
7.0.30.0100.00713.49
7.0.20.0030.01013.22
7.0.10.0120.00313.58
7.0.00.0070.01013.54
5.6.400.0040.00714.76
5.6.390.0080.00814.25
5.6.380.0030.00713.91
5.6.370.0070.00714.23
5.6.360.0000.01114.57
5.6.350.0120.00614.78
5.6.340.0060.00314.67
5.6.330.0120.00614.62
5.6.320.0120.00314.51
5.6.310.0030.01014.60
5.6.300.0120.00614.62
5.6.290.0100.00714.41
5.6.280.0040.01214.71
5.6.270.0160.00314.28
5.6.260.0100.00714.49
5.6.250.0040.01414.50
5.6.240.0030.01514.66
5.6.230.0000.00914.50
5.6.220.0120.00314.73
5.6.210.0080.00314.78
5.6.200.0100.00014.39
5.6.190.0070.01014.39
5.6.180.0030.01114.46
5.6.170.0000.00914.51
5.6.160.0120.00314.65
5.6.150.0070.01014.23
5.6.140.0060.00714.30
5.6.130.0030.00614.38
5.6.120.0060.00614.34
5.6.110.0090.00614.46
5.6.100.0140.00014.43
5.6.90.0110.00414.17
5.6.80.0060.00614.16
5.6.70.0030.01214.34
5.6.60.0090.00014.38
5.6.50.0070.00314.56
5.6.40.0060.00314.18
5.6.30.0100.00314.03
5.6.20.0040.01114.22
5.6.10.0030.01014.34
5.6.00.0000.01514.44

preferences:
29.45 ms | 403 KiB | 5 Q