3v4l.org

run code in 300+ PHP versions simultaneously
<?php function tep_get_subcategories($category_id) { $subcategories_raw = tep_db_query('SELECT ca.categories_id FROM categories ca LEFT JOIN categoreis cb ON ca.parent_id = cb.categories_id WHERE cb.categoreis_id = ' . (int) $category_id); $subcategories = array(); if (mysql_num_rows($subcategories_raw) >= 1) { while ($row = mysql_fetch_assoc($subcategories_raw)) { $category_id = $row['categories_id']; $subcategories[] = $category_id; } } return $subcategories; } function tep_get_leaf_categories($category_id) { $sub_categories = tep_get_subcategories($category_id); // no sub categories found:return self as result if (count($sub_categories) === 0) { return array($category_id); } else { foreach ($sub_categories as $category_id) { tep_get_leaf_categories($category_id); // what next? } } }

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.3.60.0040.01116.50
8.3.50.0080.01022.03
8.3.40.0100.00718.67
8.3.30.0110.00718.88
8.3.20.0040.00420.39
8.3.10.0050.00321.90
8.3.00.0060.00319.02
8.2.180.0140.00716.75
8.2.170.0120.00322.96
8.2.160.0070.00720.19
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0080.00019.83
8.2.110.0030.00620.99
8.2.100.0090.00317.78
8.2.90.0030.00517.72
8.2.80.0030.00619.69
8.2.70.0040.00417.38
8.2.60.0040.00417.68
8.2.50.0030.00518.07
8.2.40.0080.00018.09
8.2.30.0060.00317.94
8.2.20.0020.00517.50
8.2.10.0040.00417.93
8.2.00.0040.00417.48
8.1.280.0100.01325.92
8.1.270.0070.01018.79
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0000.00922.40
8.1.230.0060.00620.83
8.1.220.0080.00017.74
8.1.210.0040.00418.84
8.1.200.0060.00317.23
8.1.190.0000.00717.23
8.1.180.0040.00418.10
8.1.170.0090.00018.58
8.1.160.0040.00421.96
8.1.150.0000.00818.77
8.1.140.0040.00417.41
8.1.130.0070.00017.78
8.1.120.0000.00717.34
8.1.110.0080.00017.26
8.1.100.0040.00417.32
8.1.90.0040.00417.24
8.1.80.0040.00417.35
8.1.70.0000.00717.37
8.1.60.0030.00517.40
8.1.50.0030.00517.41
8.1.40.0030.00617.42
8.1.30.0040.00417.55
8.1.20.0040.00417.52
8.1.10.0040.00417.30
8.1.00.0040.00417.38
8.0.300.0040.00419.77
8.0.290.0030.00616.63
8.0.280.0000.00718.33
8.0.270.0030.00317.00
8.0.260.0000.00817.15
8.0.250.0000.00716.89
8.0.240.0030.00316.92
8.0.230.0050.00216.88
8.0.220.0030.00316.80
8.0.210.0040.00416.67
8.0.200.0030.00616.71
8.0.190.0040.00416.82
8.0.180.0000.00716.82
8.0.170.0040.00416.83
8.0.160.0030.00316.71
8.0.150.0040.00416.75
8.0.140.0040.00416.75
8.0.130.0030.00313.17
8.0.120.0000.00816.66
8.0.110.0000.00816.75
8.0.100.0080.00016.75
8.0.90.0050.00216.78
8.0.80.0070.00716.85
8.0.70.0040.00416.89
8.0.60.0000.00716.60
8.0.50.0040.00416.75
8.0.30.0110.01116.96
8.0.20.0090.01017.40
8.0.10.0000.00716.80
8.0.00.0120.00916.56
7.4.330.0000.00515.03
7.4.320.0000.00616.41
7.4.300.0000.00616.50
7.4.290.0000.00716.32
7.4.280.0030.00616.30
7.4.270.0060.00016.25
7.4.260.0030.00316.45
7.4.250.0000.00716.50
7.4.240.0030.00416.40
7.4.230.0000.00716.19
7.4.220.0120.00616.41
7.4.210.0080.00716.36
7.4.200.0000.00716.60
7.4.160.0030.01416.29
7.4.150.0040.01717.40
7.4.140.0070.01117.86
7.4.130.0080.01116.37
7.4.120.0100.00716.38
7.4.110.0180.00616.54
7.4.100.0090.00916.39
7.4.90.0100.01016.50
7.4.80.0090.01316.32
7.4.70.0070.01016.48
7.4.60.0110.00616.51
7.4.50.0040.00016.17
7.4.40.0100.01016.40
7.4.30.0090.00916.38
7.4.00.0070.00314.58
7.3.330.0000.00713.20
7.3.320.0040.00913.13
7.3.310.0000.00716.05
7.3.300.0040.00416.20
7.3.290.0030.00316.24
7.3.280.0070.00916.18
7.3.270.0140.00417.40
7.3.260.0130.01016.45
7.3.250.0110.00616.25
7.3.240.0060.01016.05
7.3.230.0110.00816.39
7.3.210.0070.01016.18
7.3.200.0070.01019.39
7.3.190.0100.01016.09
7.3.180.0060.01016.12
7.3.170.0120.00616.27
7.3.160.0160.00616.41
7.2.330.0100.00716.37
7.2.320.0080.00816.61
7.2.310.0150.00316.42
7.2.300.0060.01216.53
7.2.290.0100.01316.19
7.2.80.0180.00016.23
7.2.60.0030.01016.44
7.1.200.0000.00915.61
7.1.70.0030.00616.93
7.1.60.0100.01319.46
7.1.50.0090.01216.51
7.1.00.0030.07722.28
7.0.200.0280.00414.88
7.0.140.0070.05022.02
7.0.60.0070.05019.80
7.0.50.0130.04317.91
7.0.40.0100.08320.30
7.0.30.0230.06320.21
7.0.20.0200.04320.30
7.0.10.0070.09020.23
7.0.00.0030.05720.18
5.6.280.0130.06321.08
5.6.210.0070.08320.61
5.6.200.0100.06318.27
5.6.190.0170.07720.63
5.6.180.0270.05020.61
5.6.170.0330.06720.71
5.6.160.0070.04020.50
5.6.150.0130.05718.23
5.6.140.0130.05718.23
5.6.130.0030.08318.27
5.6.120.0070.07721.13
5.6.110.0100.08721.10
5.6.100.0030.05021.12
5.6.90.0000.04320.94
5.6.80.0100.04020.53
5.5.350.0300.05720.43
5.5.340.0070.04317.99
5.5.330.0000.04320.43
5.5.320.0130.07720.27
5.5.310.0400.08020.27
5.5.300.0070.07317.97
5.5.290.0100.03318.08
5.5.280.0170.07320.88
5.5.270.0030.08320.95
5.5.260.0070.05320.88
5.5.250.0130.07720.80
5.5.240.0030.05020.16
5.4.450.0530.06019.39
5.4.440.1130.05019.63
5.4.430.0130.05019.44
5.4.420.1030.05019.62
5.4.410.0930.06019.49
5.4.400.0130.04718.89
5.4.390.0130.05718.59
5.4.380.0170.05718.76
5.4.370.0200.07318.61
5.4.360.0200.07318.60
5.4.350.0230.05718.84
5.4.340.0130.06018.59
5.4.320.0230.05718.74
5.4.310.0070.06718.59
5.4.300.0130.05718.63
5.4.290.0270.06318.56
5.4.280.0270.05318.64
5.4.270.0230.05018.80
5.4.260.0170.05318.80
5.4.250.0070.06718.63
5.4.240.0300.04318.53
5.4.230.0230.04718.55
5.4.220.0130.05718.61
5.4.210.0230.05018.82
5.4.200.0200.04716.79
5.4.190.0200.05718.56
5.4.180.0230.05018.68
5.4.170.0230.05718.73
5.4.160.0130.06318.76
5.4.150.0100.06018.55
5.4.140.0200.05016.18
5.4.130.0230.04716.22
5.4.120.0130.05316.27
5.4.110.0270.06016.23
5.4.100.0230.04316.46
5.4.90.0270.04316.26
5.4.80.0200.04716.42
5.4.70.0200.05016.26
5.4.60.0230.05016.31
5.4.50.0170.05016.29
5.4.40.0130.05316.27
5.4.30.0200.04716.29
5.4.20.0270.04016.29
5.4.10.0070.05716.25
5.4.00.0200.04315.82
5.3.290.0230.05314.89
5.3.280.0230.06714.73
5.3.270.0170.05714.64
5.3.260.0230.05014.65
5.3.250.0100.06014.74
5.3.240.0270.04314.67
5.3.230.0170.05314.77
5.3.220.0130.05714.57
5.3.210.0230.05014.55
5.3.200.0230.04314.59
5.3.190.0130.06014.68
5.3.180.0300.04314.57
5.3.170.0300.05014.67
5.3.160.0330.04014.57
5.3.150.0130.05314.56
5.3.140.0200.04714.61
5.3.130.0330.04014.77
5.3.120.0170.05714.61
5.3.110.0130.06314.59
5.3.100.0270.05314.18
5.3.90.0170.07014.22
5.3.80.0170.05314.04
5.3.70.0300.04714.02
5.3.60.0170.05714.11
5.3.50.0200.05013.93
5.3.40.0170.06013.97
5.3.30.0200.04713.97
5.3.20.0300.03713.90
5.3.10.0270.04313.83
5.3.00.0330.03313.70
5.2.170.0130.04311.27
5.2.160.0270.05011.23
5.2.150.0200.05011.35
5.2.140.0130.05011.16
5.2.130.0130.06311.23
5.2.120.0130.04011.18
5.2.110.0100.04311.09
5.2.100.0170.05011.09
5.2.90.0100.04311.11
5.2.80.0230.05011.13
5.2.70.0130.06011.10
5.2.60.0100.05311.09
5.2.50.0100.06311.16
5.2.40.0200.05310.98
5.2.30.0200.05311.17
5.2.20.0200.04711.18
5.2.10.0130.04010.84
5.2.00.0170.04310.77
5.1.60.0070.04010.00
5.1.50.0170.04310.20
5.1.40.0130.03710.12
5.1.30.0170.03310.45
5.1.20.0170.04310.48
5.1.10.0100.04010.09
5.1.00.0270.02710.13
5.0.50.0100.0338.75
5.0.40.0070.0308.50
5.0.30.0170.0378.27
5.0.20.0100.0278.21
5.0.10.0100.0278.17
5.0.00.0070.0578.22
4.4.90.0100.0275.94
4.4.80.0070.0205.91
4.4.70.0130.0275.89
4.4.60.0170.0205.91
4.4.50.0030.0335.98
4.4.40.0130.0405.90
4.4.30.0070.0205.91
4.4.20.0000.0306.02
4.4.10.0130.0275.99
4.4.00.0070.0475.91
4.3.110.0070.0335.91
4.3.100.0070.0275.93
4.3.90.0070.0205.91
4.3.80.0030.0375.81
4.3.70.0130.0135.79
4.3.60.0070.0205.88
4.3.50.0070.0235.77
4.3.40.0100.0305.77
4.3.30.0030.0274.59
4.3.20.0000.0274.56
4.3.10.0100.0234.51
4.3.00.0200.01314.42

preferences:
58.2 ms | 401 KiB | 5 Q