3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * ageCheck method * * This is a custom validation method that converts the date of birth into an age and then checks to see if the age falls within the teams level age range * * @param array $check This is the value for date of birth field * @param string $level_id This is the level_id selected for this competitor's team * @return bool */ function ageCheck($check, $level_id) { $dob = array_shift($check); $dob = new DateTime($dob); $today = new DateTime('today'); $age = $dob->diff($today)->y; $age_range = '36-37'; $age_range_arr = explode('-', $age_range); if (stripos($age_range,'N/A') !== false) { return true; } if ($age >= $age_range_arr[0] && $age <= $age_range_arr[1]) { return true; } return 'You must select a date of birth where the competitor\'s age is between ' . $age_range_arr[0] . ' and ' . $age_range_arr[1] . ' years old'; } echo ageCheck(array('dob' => '1978-11-21'), NULL);

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.0070.01116.75
8.3.50.0100.01022.06
8.3.40.0070.01118.92
8.3.30.0160.00319.23
8.3.20.0070.00020.21
8.3.10.0040.00423.52
8.3.00.0080.00419.63
8.2.180.0150.00616.63
8.2.170.0120.00322.96
8.2.160.0150.00020.47
8.2.150.0050.00324.18
8.2.140.0060.00324.66
8.2.130.0000.00726.16
8.2.120.0000.00722.11
8.2.110.0090.00022.23
8.2.100.0060.00618.28
8.2.90.0000.00919.21
8.2.80.0000.00817.97
8.2.70.0040.00417.88
8.2.60.0050.00318.05
8.2.50.0030.00618.07
8.2.40.0060.00318.15
8.2.30.0030.00618.11
8.2.20.0000.00817.86
8.2.10.0080.00018.26
8.2.00.0040.00417.88
8.1.280.0070.01425.92
8.1.270.0040.00423.96
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00323.84
8.1.230.0070.00419.08
8.1.220.0080.00017.79
8.1.210.0040.00418.77
8.1.200.0080.00317.38
8.1.190.0090.00017.48
8.1.180.0000.01119.13
8.1.170.0000.00818.76
8.1.160.0000.00722.05
8.1.150.0040.00418.84
8.1.140.0070.00017.66
8.1.130.0030.00317.89
8.1.120.0040.00417.70
8.1.110.0060.00317.65
8.1.100.0040.00417.65
8.1.90.0040.00417.66
8.1.80.0040.00417.64
8.1.70.0070.00017.61
8.1.60.0000.00717.63
8.1.50.0050.00317.63
8.1.40.0050.00317.64
8.1.30.0000.00817.70
8.1.20.0000.00717.82
8.1.10.0080.00017.56
8.1.00.0040.00417.56
8.0.300.0060.00318.77
8.0.290.0000.00817.30
8.0.280.0070.00018.52
8.0.270.0070.00017.45
8.0.260.0000.00817.35
8.0.250.0030.00317.18
8.0.240.0000.00717.18
8.0.230.0030.00317.23
8.0.220.0070.00016.93
8.0.210.0030.00317.11
8.0.200.0030.00317.17
8.0.190.0070.00017.17
8.0.180.0000.00717.16
8.0.170.0070.00017.11
8.0.160.0070.00017.09
8.0.150.0030.00317.00
8.0.140.0040.00417.12
8.0.130.0040.00413.46
8.0.120.0080.00017.08
8.0.110.0060.00316.99
8.0.100.0050.00317.21
8.0.90.0000.00717.13
8.0.80.0000.01617.15
8.0.70.0050.00216.96
8.0.60.0070.00017.22
8.0.50.0000.00817.04
8.0.30.0060.01217.22
8.0.20.0110.00817.40
8.0.10.0050.00217.00
8.0.00.0100.00816.89
7.4.330.0000.00615.15
7.4.320.0000.00616.73
7.4.300.0080.00016.75
7.4.290.0030.00516.72
7.4.280.0040.00416.65
7.4.270.0000.00816.80
7.4.260.0070.00016.63
7.4.250.0000.00716.64
7.4.240.0040.00416.71
7.4.230.0030.00316.73
7.4.220.0090.00816.66
7.4.210.0110.00816.76
7.4.200.0040.00416.83
7.4.190.0070.00016.80
7.4.160.0040.01816.77
7.4.150.0130.00417.40
7.4.140.0070.01517.86
7.4.130.0080.01216.68
7.4.120.0100.00816.59
7.4.110.0110.00716.53
7.4.100.0100.00716.66
7.4.90.0040.01516.81
7.4.80.0040.01319.39
7.4.70.0120.01216.73
7.4.60.0060.00916.51
7.4.50.0040.00016.75
7.4.40.0080.01116.65
7.4.30.0070.01516.84
7.4.10.0030.01315.14
7.4.00.0100.00715.04
7.3.330.0000.00513.36
7.3.320.0000.00513.44
7.3.310.0060.00316.57
7.3.300.0030.00316.37
7.3.290.0030.01416.39
7.3.280.0050.01216.48
7.3.270.0030.01317.40
7.3.260.0080.00916.52
7.3.250.0160.00916.64
7.3.240.0080.00816.43
7.3.230.0090.00916.69
7.3.210.0160.00016.39
7.3.200.0110.00819.39
7.3.190.0090.00916.54
7.3.180.0090.01216.50
7.3.170.0100.00716.63
7.3.160.0170.00616.64
7.3.130.0040.01514.93
7.3.120.0050.01114.93
7.3.110.0000.01815.11
7.3.100.0080.00414.88
7.3.90.0100.00315.13
7.3.80.0040.01114.94
7.3.70.0070.01014.79
7.3.60.0060.00815.01
7.3.50.0100.00014.68
7.3.40.0000.01315.04
7.3.30.0120.00315.00
7.3.20.0030.00916.66
7.3.10.0000.00916.71
7.3.00.0040.00416.86
7.2.330.0080.01217.02
7.2.320.0120.00917.13
7.2.310.0100.00716.97
7.2.300.0060.01016.69
7.2.290.0160.00316.97
7.2.260.0100.00315.35
7.2.250.0030.01715.54
7.2.240.0060.00915.34
7.2.230.0040.01115.26
7.2.220.0130.00315.14
7.2.210.0060.00915.39
7.2.200.0000.00915.07
7.2.190.0000.01215.11
7.2.180.0060.00315.00
7.2.170.0100.00615.28
7.2.160.0140.00415.30
7.2.150.0100.00317.29
7.2.140.0070.00316.96
7.2.130.0040.00716.82
7.2.120.0040.01417.09
7.2.110.0100.00317.09
7.2.100.0050.00516.84
7.2.90.0090.00617.13
7.2.80.0100.00917.09
7.2.70.0110.00317.14
7.2.60.0070.00517.10
7.2.50.0100.00716.89
7.2.40.0040.01417.26
7.2.30.0060.00917.10
7.2.20.0030.01016.90
7.2.10.0110.00417.03
7.2.00.0060.00818.35
7.1.330.0110.00416.12
7.1.320.0000.00915.85
7.1.310.0040.00716.09
7.1.300.0080.00815.99
7.1.290.0000.01015.68
7.1.280.0140.00315.70
7.1.270.0070.00315.66
7.1.260.0040.01116.03
7.1.250.0120.00416.01
7.1.240.0030.01015.98
7.1.230.0070.00616.08
7.1.220.0090.00615.57
7.1.210.0130.00315.74
7.1.200.0090.00515.91
7.1.190.0040.00816.02
7.1.180.0060.00615.93
7.1.170.0030.01415.84
7.1.160.0070.00715.86
7.1.150.0000.01016.13
7.1.140.0000.01215.96
7.1.130.0070.00715.75
7.1.120.0130.00015.88
7.1.110.0070.00715.80
7.1.100.0060.00917.24
7.1.90.0030.00615.89
7.1.80.0090.00316.06
7.1.70.0060.00516.63
7.1.60.0070.01317.81
7.1.50.0090.00516.62
7.1.40.0070.00715.82
7.1.30.0050.00415.96
7.1.20.0070.00715.67
7.1.10.0060.00615.93
7.1.00.0050.04019.18
7.0.330.0100.00715.31
7.0.320.0060.00615.51
7.0.310.0080.00415.28
7.0.300.0090.00915.46
7.0.290.0070.00715.41
7.0.280.0040.00715.13
7.0.270.0080.00415.44
7.0.260.0050.00515.27
7.0.250.0130.00015.40
7.0.240.0070.00715.35
7.0.230.0070.00715.52
7.0.220.0060.00615.43
7.0.210.0050.00515.75
7.0.200.0070.00316.21
7.0.190.0090.00315.63
7.0.180.0030.01015.49
7.0.170.0100.00015.58
7.0.160.0090.00015.70
7.0.150.0090.00615.64
7.0.140.0020.04118.76
7.0.130.0040.01115.61
7.0.120.0040.00815.42
7.0.110.0070.00315.51
7.0.100.0080.00315.56
7.0.90.0070.00715.63
7.0.80.0000.01515.42
7.0.70.0030.01115.49
7.0.60.0130.04017.54
7.0.50.0080.02516.83
7.0.40.0070.03916.96
7.0.30.0230.03516.97
7.0.20.0130.04216.84
7.0.10.0110.04216.96
7.0.00.0090.04416.90
5.6.400.0100.01014.69
5.6.390.0070.01014.49
5.6.380.0030.01014.59
5.6.370.0040.01214.55
5.6.360.0030.01314.88
5.6.350.0070.00714.50
5.6.340.0030.01014.69
5.6.330.0040.01114.68
5.6.320.0080.00814.67
5.6.310.0080.00314.32
5.6.300.0120.00314.39
5.6.290.0100.00314.63
5.6.280.0020.04117.59
5.6.270.0070.00714.76
5.6.260.0030.01214.63
5.6.250.0040.01114.33
5.6.240.0040.00814.53
5.6.230.0000.01514.44
5.6.220.0040.01214.52
5.6.210.0080.03917.53
5.6.200.0150.03816.23
5.6.190.0080.04617.50
5.6.180.0080.02517.47
5.6.170.0190.03317.50
5.6.160.0080.04217.33
5.6.150.0050.03016.42
5.6.140.0060.02516.32
5.6.130.0070.05016.50
5.6.120.0070.04117.72
5.6.110.0070.04517.74
5.6.100.0100.03917.75
5.6.90.0050.04017.76
5.6.80.0070.04417.55
5.6.70.0080.00414.26
5.6.60.0090.00314.47
5.6.50.0030.00914.41
5.6.40.0140.00014.40
5.6.30.0040.01414.62
5.6.20.0120.00014.21
5.6.10.0030.01314.29
5.6.00.0000.01314.54
5.5.380.0150.00014.23
5.5.370.0090.00614.56
5.5.360.0060.00614.42
5.5.350.1990.02217.49
5.5.340.0090.03616.19
5.5.330.0110.02217.18
5.5.320.0200.03817.34
5.5.310.0230.03317.27
5.5.300.0050.05016.16
5.5.290.0090.04216.15
5.5.280.0100.04517.41
5.5.270.0080.04617.60
5.5.260.0070.04117.64
5.5.250.0040.02317.55
5.5.240.0020.04817.40
5.5.230.0090.00314.31
5.5.220.0110.00414.14
5.5.210.0070.01114.39
5.5.200.0040.01514.14
5.5.190.0040.00814.43
5.5.180.0050.00814.20
5.5.170.0000.00914.39
5.5.160.0030.01013.99
5.5.150.0040.01114.49
5.5.140.0000.01614.18
5.5.130.0030.01313.70
5.5.120.0000.01814.25
5.5.110.0110.00614.05
5.5.100.0070.01013.91
5.5.90.0090.00614.10
5.5.80.0000.01914.45
5.5.70.0050.00513.83
5.5.60.0060.00914.37
5.5.50.0110.00414.38
5.5.40.0080.00814.04
5.5.30.0050.01014.18
5.5.20.0130.00014.64
5.5.10.0000.01414.26
5.5.00.0060.01214.21
5.4.450.0080.03415.52
5.4.440.0170.03015.59
5.4.430.0160.02815.58
5.4.420.0190.02815.53
5.4.410.0100.04315.52
5.4.400.0160.02915.22
5.4.390.0080.03715.42
5.4.380.0120.03815.20
5.4.370.0250.02815.09
5.4.360.0150.02515.21
5.4.350.0120.03015.14
5.4.340.0080.02915.11
5.4.330.0040.01111.59
5.4.320.0090.02012.05
5.4.310.0080.02212.04
5.4.300.0070.02812.05
5.4.290.0050.02512.04
5.4.280.0030.02511.99
5.4.270.0080.02211.99
5.4.260.0050.02811.99
5.4.250.0100.02011.99
5.4.240.0090.01811.99
5.4.230.0040.02411.99
5.4.220.0090.01811.99
5.4.210.0040.02111.99
5.4.200.0040.02211.99
5.4.190.0060.02311.99
5.4.180.0020.02611.98
5.4.170.0040.02311.99
5.4.160.0040.02311.99
5.4.150.0060.02211.99
5.4.140.0060.02311.83
5.4.130.0040.02311.82
5.4.120.0030.02311.80
5.4.110.0050.02211.80
5.4.100.0080.01811.80
5.4.90.0070.02111.80
5.4.80.0070.01811.80
5.4.70.0070.02111.80
5.4.60.0040.02411.80
5.4.50.0070.02211.80
5.4.40.0070.02811.79
5.4.30.0100.02411.79
5.4.20.0050.02811.79
5.4.10.0040.03211.79
5.4.00.0050.03011.54
5.3.290.0070.02312.19
5.3.280.0060.02912.15
5.3.270.0100.02512.15
5.3.260.0070.03012.15
5.3.250.0040.02812.15
5.3.240.0080.02612.15
5.3.230.0050.02812.15
5.3.220.0040.02512.13
5.3.210.0070.02312.13
5.3.200.0050.02612.13
5.3.190.0080.02112.13
5.3.180.0060.02312.13
5.3.170.0040.02412.13
5.3.160.0070.01912.13
5.3.150.0050.02312.13
5.3.140.0050.02212.13
5.3.130.0090.02312.12
5.3.120.0060.02412.12
5.3.110.0040.02512.12
5.3.100.0100.01911.85
5.3.90.0060.02211.85
5.3.80.0050.02011.84
5.3.70.0080.01911.84
5.3.60.0060.01811.83
5.3.50.0070.02011.81
5.3.40.0050.02411.80
5.3.30.0060.02111.79
5.3.20.0090.01811.67
5.3.10.0060.02111.66
5.3.00.0040.02311.65
5.2.170.0070.0289.23
5.2.160.0060.0289.23
5.2.150.0090.0269.23
5.2.140.0040.0329.23
5.2.130.0060.0309.18
5.2.120.0040.0389.18
5.2.110.0040.0299.19
5.2.100.0050.0289.18
5.2.90.0040.0309.18
5.2.80.0010.0339.18
5.2.70.0090.0269.18
5.2.60.0040.0329.14
5.2.50.0050.0309.10
5.2.40.0070.0279.08
5.2.30.0030.0319.05
5.2.20.0060.0289.04
5.2.10.0070.0328.95
5.2.00.0070.0438.81
5.1.60.0040.0378.09
5.1.50.0090.0308.09
5.1.40.0040.0288.07
5.1.30.0060.0278.41
5.1.20.0080.0248.44
5.1.10.0050.0278.17
5.1.00.0030.0398.17
5.0.50.0060.0286.66
5.0.40.0070.0276.52
5.0.30.0050.0476.33
5.0.20.0050.0286.29
5.0.10.0060.0276.28
5.0.00.0070.0306.27
4.4.90.0030.0244.77
4.4.80.0020.0164.75
4.4.70.0030.0164.75
4.4.60.0040.0154.76
4.4.50.0020.0174.77
4.4.40.0020.0274.71
4.4.30.0040.0174.76
4.4.20.0030.0194.84
4.4.10.0030.0264.85
4.4.00.0040.0364.76
4.3.110.0050.0194.67
4.3.100.0040.0224.67
4.3.90.0060.0184.64
4.3.80.0030.0324.58
4.3.70.0020.0184.63
4.3.60.0030.0224.63
4.3.50.0060.0194.62
4.3.40.0030.0254.54
4.3.30.0010.0183.30
4.3.20.0020.0163.28
4.3.10.0020.0153.25
4.3.00.0030.0307.34

preferences:
36.65 ms | 401 KiB | 5 Q