3v4l.org

run code in 300+ PHP versions simultaneously
<?php enum AgeRangeType { case UNSPECIFIED; // Not specified. case UNKNOWN; // Used for return value only. Represents value unknown in this version. case AGE_RANGE_18_24; // Between 18 and 24 years old. case AGE_RANGE_25_34; // Between 25 and 34 years old. case AGE_RANGE_35_44; // Between 35 and 44 years old. case AGE_RANGE_45_54; // Between 45 and 54 years old. case AGE_RANGE_55_64; // Between 55 and 64 years old. case AGE_RANGE_65_UP; // 65 years old and beyond. case AGE_RANGE_UNDETERMINED; // Undetermined age range. } $ageRanges = [ AgeRangeType::AGE_RANGE_18_24->name => ['min' => 18, 'max' => 24], AgeRangeType::AGE_RANGE_25_34->name => ['min' => 25, 'max' => 34], AgeRangeType::AGE_RANGE_35_44->name => ['min' => 35, 'max' => 44], AgeRangeType::AGE_RANGE_45_54->name => ['min' => 45, 'max' => 54], AgeRangeType::AGE_RANGE_55_64->name => ['min' => 55, 'max' => 64], AgeRangeType::AGE_RANGE_65_UP->name => ['min' => 65, 'max' => 135] ]; $min_age = 20; $max_age = 60; $result = []; foreach ($ageRanges as $enum => ['min' => $min, 'max' => $max]) { if ($max >= $min_age && $min <= $max_age) { $result[] = $enum; } elseif ($result) { break; } } var_export($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.140.0130.00717.53
8.4.130.0070.00517.95
8.4.120.0120.00824.15
8.4.110.0110.00918.88
8.4.100.0090.00718.10
8.4.90.0170.00320.71
8.4.80.0050.00718.82
8.4.70.0160.00620.52
8.4.60.0050.00420.68
8.4.50.0080.00218.70
8.4.40.0030.00719.37
8.4.30.0130.00620.69
8.4.20.0210.00317.79
8.4.10.0130.00721.96
8.3.270.0160.00516.61
8.3.260.0130.00716.61
8.3.250.0070.00117.09
8.3.240.0110.00917.29
8.3.230.0110.00916.51
8.3.220.0110.00819.10
8.3.210.0100.00916.71
8.3.200.0030.00516.54
8.3.190.0120.00818.93
8.3.180.0110.00718.98
8.3.170.0050.00316.92
8.3.160.0140.00020.91
8.3.150.0120.00417.12
8.3.140.0110.00321.02
8.3.130.0030.00516.66
8.3.120.0060.00319.14
8.3.110.0080.00022.58
8.3.100.0090.00922.58
8.3.90.0000.00822.58
8.3.50.0060.00322.58
8.2.290.0100.01020.64
8.2.280.0120.00818.43
8.2.270.0130.00616.83
8.2.260.0060.00317.24
8.2.250.0030.00616.68
8.2.240.0070.00017.50
8.2.230.0020.00522.58
8.2.220.0040.00422.58
8.2.210.0000.00722.58
8.1.330.0110.00822.07
8.1.320.0130.00717.96
8.1.310.0080.00816.78
8.1.300.0040.00419.54
8.1.50.0050.00917.51
8.1.40.0160.00217.52
8.1.30.0130.00817.59
8.1.20.0230.00317.55
8.1.10.0090.00617.45
8.1.00.0030.01117.46
8.0.180.0110.00616.84
8.0.170.0060.00616.84
8.0.160.0000.01316.84
8.0.150.0130.00516.84
8.0.140.0140.00216.71
8.0.130.0150.00316.76
8.0.120.0170.00016.80
8.0.110.0120.00916.80
8.0.100.0150.00516.87
8.0.90.0200.00016.88
8.0.80.0120.00816.89
8.0.70.0110.00816.73
8.0.60.0150.00616.76
8.0.50.0140.00716.71
8.0.30.0200.00616.89
8.0.20.0160.00916.75
8.0.10.0180.00516.86
7.4.290.0240.00016.26
7.4.280.0200.00716.31
7.4.270.0210.00616.32
7.4.260.0170.00716.15
7.4.250.0150.01116.29
7.4.240.0200.00016.30
7.4.230.0250.00616.25
7.4.220.0310.00016.22
7.4.210.0200.00316.41
7.4.200.0260.00016.33
7.4.190.0200.00516.47
7.4.180.0180.00516.46
7.4.160.0160.00816.25
7.4.150.0240.00016.46
7.4.140.0110.01116.28
7.4.130.0180.00816.29
7.4.120.0170.00616.34
7.4.110.0160.00816.10
7.4.100.0160.00416.24
7.4.90.0190.00616.17
7.4.80.0200.00316.19
7.4.70.0180.00516.27
7.4.60.0190.00616.24
7.4.50.0140.00916.27
7.4.40.0230.00016.15
7.4.30.0150.00616.16
7.4.20.0200.00316.30
7.4.10.0140.00716.11
7.4.00.0130.00916.23

preferences:
29 ms | 403 KiB | 5 Q