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 = '32-40'; $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] . '-' . $age_range_arr[1]; } 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.0140.00316.50
8.3.50.0100.01022.04
8.3.40.0040.01118.99
8.3.30.0120.00319.22
8.3.20.0080.00020.21
8.3.10.0080.00023.53
8.3.00.0030.00717.63
8.2.180.0070.01317.00
8.2.170.0070.00722.96
8.2.160.0170.00020.27
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0050.00226.16
8.2.120.0000.00822.11
8.2.110.0040.00420.52
8.2.100.0060.00617.77
8.2.90.0050.00319.17
8.2.80.0090.00017.97
8.2.70.0090.00017.88
8.2.60.0000.00818.18
8.2.50.0050.00318.07
8.2.40.0030.00520.07
8.2.30.0050.00518.22
8.2.20.0000.00918.04
8.2.10.0000.00718.20
8.2.00.0000.00817.93
8.1.280.0120.00325.92
8.1.270.0080.00023.79
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.01023.79
8.1.230.0040.00717.70
8.1.220.0060.00317.80
8.1.210.0040.00718.77
8.1.200.0030.00617.35
8.1.190.0040.00417.38
8.1.180.0060.00319.13
8.1.170.0000.00918.78
8.1.160.0050.00221.93
8.1.150.0040.00418.75
8.1.140.0000.00717.72
8.1.130.0030.00317.80
8.1.120.0070.00017.64
8.1.110.0040.00417.70
8.1.100.0050.00317.65
8.1.90.0050.00217.58
8.1.80.0000.00717.66
8.1.70.0000.00717.65
8.1.60.0000.00817.76
8.1.50.0040.00417.65
8.1.40.0000.00717.56
8.1.30.0080.00017.55
8.1.20.0030.00517.73
8.1.10.0000.00817.72
8.1.00.0080.00017.64
8.0.300.0000.00718.77
8.0.290.0070.00016.88
8.0.280.0000.00818.53
8.0.270.0030.00317.34
8.0.260.0000.00717.25
8.0.250.0000.00717.05
8.0.240.0090.00017.21
8.0.230.0050.00217.13
8.0.220.0030.00317.07
8.0.210.0040.00417.06
8.0.200.0080.00017.14
8.0.190.0030.00617.20
8.0.180.0050.00317.09
8.0.170.0040.00417.13
8.0.160.0040.00417.15
8.0.150.0000.00816.98
8.0.140.0040.00416.89
8.0.130.0050.00013.42
8.0.120.0040.00417.03
8.0.110.0040.00417.07
8.0.100.0070.00016.96
8.0.90.0050.00217.11
8.0.80.0070.01316.98
8.0.70.0040.00417.16
8.0.60.0070.00017.13
8.0.50.0040.00416.95
8.0.30.0170.00417.24
8.0.20.0100.01317.40
8.0.10.0040.00417.06
8.0.00.0110.00816.82
7.4.330.0000.00615.21
7.4.320.0060.00016.64
7.4.300.0030.00316.69
7.4.290.0040.00416.69
7.4.280.0070.00016.57
7.4.270.0040.00416.67
7.4.260.0050.00216.64
7.4.250.0040.00416.61
7.4.240.0040.00416.71
7.4.230.0080.00016.54
7.4.220.0100.00716.70
7.4.210.0110.00316.74
7.4.200.0000.00716.50
7.4.190.0000.00716.81
7.4.160.0030.01316.66
7.4.150.0090.01217.40
7.4.140.0080.00817.86
7.4.130.0110.00916.77
7.4.120.0150.00516.65
7.4.110.0090.01416.93
7.4.100.0060.01216.67
7.4.90.0140.00416.70
7.4.80.0140.00319.39
7.4.70.0090.00616.67
7.4.60.0060.00916.71
7.4.50.0040.00416.81
7.4.40.0100.00716.81
7.4.30.0060.01116.64
7.4.00.0070.01115.08
7.3.330.0000.00513.36
7.3.320.0020.00213.51
7.3.310.0040.00416.52
7.3.300.0030.00316.51
7.3.290.0040.01116.45
7.3.280.0110.00616.45
7.3.270.0070.01017.40
7.3.260.0120.00616.59
7.3.250.0140.00816.71
7.3.240.0090.00816.48
7.3.230.0070.01016.43
7.3.210.0090.00916.87
7.3.200.0150.01419.39
7.3.190.0040.01516.53
7.3.180.0040.01316.52
7.3.170.0110.00916.73
7.3.160.0070.01016.76
7.3.120.0070.01014.89
7.3.110.0040.01214.99
7.3.100.0070.00715.04
7.3.90.0070.00914.84
7.3.80.0080.00714.97
7.3.70.0030.01115.04
7.3.60.0030.01014.98
7.3.50.0050.00814.95
7.3.40.0060.00814.98
7.3.30.0070.00514.97
7.3.20.0080.00916.79
7.3.10.0280.00616.78
7.3.00.0130.01216.73
7.2.330.0160.00316.60
7.2.320.0100.01016.96
7.2.310.0000.01616.75
7.2.300.0110.00716.99
7.2.290.0060.01517.07
7.2.250.0100.00915.21
7.2.240.0110.00915.21
7.2.230.0050.01415.36
7.2.220.0040.01315.10
7.2.210.0000.01215.15
7.2.200.0080.00515.23
7.2.190.0070.00615.05
7.2.180.0040.01015.12
7.2.170.0070.00915.00
7.2.130.0550.00716.71
7.2.120.0190.01616.87
7.2.110.0260.00816.90
7.2.100.0200.00316.90
7.2.90.0340.01117.02
7.2.80.0150.01516.88
7.2.70.0140.01416.85
7.2.60.0260.00216.91
7.2.50.0270.00516.83
7.2.40.0260.01516.95
7.2.30.0250.01617.07
7.2.20.0250.01217.10
7.2.10.0250.00316.92
7.2.00.0110.01318.33
7.1.330.0050.01015.93
7.1.320.0070.00615.75
7.1.310.0030.01116.07
7.1.300.0020.01315.94
7.1.290.0040.01015.96
7.1.280.0060.00715.97
7.1.270.0050.00815.74
7.1.260.0030.00816.04
7.1.250.0420.00615.93
7.1.200.0030.00915.80
7.1.100.0030.00917.85
7.1.70.0050.00317.52
7.1.60.0070.01719.46
7.1.50.0150.00317.11
7.1.00.0030.07722.42
7.0.200.0040.00417.02
7.0.140.0100.06722.08
7.0.60.0100.07319.92
7.0.50.0030.08717.89
7.0.40.0130.03720.27
7.0.30.0370.05020.17
7.0.20.0230.04320.22
7.0.10.0100.05320.16
7.0.00.0170.05320.25
5.6.280.0070.07021.04
5.6.210.0070.03720.73
5.6.200.0070.08718.18
5.6.190.0030.09020.41
5.6.180.0170.03320.34
5.6.170.0330.05320.54
5.6.160.0230.07320.52
5.6.150.0100.08018.16
5.6.140.0070.07318.27
5.6.130.0100.05718.21
5.6.120.0070.05020.98
5.6.110.0130.08020.99
5.6.100.0070.09320.98
5.6.90.0000.09321.04
5.6.80.0030.08720.53
5.5.350.4000.04320.41
5.5.340.0100.07718.08
5.5.330.0030.05720.22
5.5.320.0330.06020.36
5.5.310.0370.05720.36
5.5.300.0100.07018.01
5.5.290.0030.07017.94
5.5.280.0070.06020.66
5.5.270.0100.05720.74
5.5.260.0000.05720.85
5.5.250.0070.04020.71
5.5.240.0000.03320.20
5.4.450.0430.06019.56
5.4.440.0230.05719.64
5.4.430.0370.04719.63
5.4.420.0170.05719.18
5.4.410.0130.07319.45
5.4.400.0130.06019.29
5.4.390.0270.05319.30
5.4.380.0100.06018.53
5.4.370.0170.05018.62
5.4.360.0230.04718.79
5.4.350.0070.06018.57
5.4.340.0230.04318.61
5.4.320.0040.03812.50
5.4.310.0050.04112.50
5.4.300.0060.04012.51
5.4.290.0070.04712.50
5.4.280.0060.05712.40
5.4.270.0090.04812.40
5.4.260.0090.04012.40
5.4.250.0090.04412.40
5.4.240.0060.03612.40
5.4.230.0060.03912.39
5.4.220.0070.03812.39
5.4.210.0080.03512.39
5.4.200.0030.04312.39
5.4.190.0110.03612.39
5.4.180.0080.05412.38
5.4.170.0050.05512.39
5.4.160.0110.05112.39
5.4.150.0110.04312.39
5.4.140.0060.05012.07
5.4.130.0110.05112.06
5.4.120.0090.05012.02
5.4.110.0060.05212.01
5.4.100.0080.03712.01
5.4.90.0040.05612.01
5.4.80.0060.03912.02
5.4.70.0060.03512.01
5.4.60.0060.03612.01
5.4.50.0040.04012.01
5.4.40.0080.03411.99
5.4.30.0050.03612.00
5.4.20.0060.03512.00
5.4.10.0060.04211.99
5.4.00.0110.04511.48
5.3.290.0050.04012.80
5.3.280.0090.05212.71
5.3.270.0100.05112.72
5.3.260.0150.04612.72
5.3.250.0120.05212.72
5.3.240.0170.06112.72
5.3.230.0180.07112.71
5.3.220.0100.04612.68
5.3.210.0100.03712.68
5.3.200.0050.04312.68
5.3.190.0090.04512.68
5.3.180.0070.05312.67
5.3.170.0120.05312.67
5.3.160.0060.03612.68
5.3.150.0050.03912.67
5.3.140.0030.04012.66
5.3.130.0010.04412.66
5.3.120.0060.03912.66
5.3.110.0100.03812.66
5.3.100.0110.03412.12
5.3.90.0030.04112.10
5.3.80.0050.03912.09
5.3.70.0080.04412.09
5.3.60.0070.05112.08
5.3.50.0090.04112.02
5.3.40.0060.05212.03
5.3.30.0080.05911.98
5.3.20.0130.03611.76
5.3.10.0110.03011.73
5.3.00.0050.03811.72
5.2.170.0040.0329.23
5.2.160.0040.0309.23
5.2.150.0060.0309.23
5.2.140.0020.0339.23
5.2.130.0080.0259.18
5.2.120.0060.0279.19
5.2.110.0060.0289.19
5.2.100.0040.0309.18
5.2.90.0080.0279.18
5.2.80.0050.0319.18
5.2.70.0040.0319.18
5.2.60.0070.0339.13
5.2.50.0040.0339.10
5.2.40.0100.0309.08
5.2.30.0060.0309.05
5.2.20.0030.0319.04
5.2.10.0050.0288.95
5.2.00.0040.0318.81
5.1.60.0030.0278.10
5.1.50.0040.0268.09
5.1.40.0030.0278.07
5.1.30.0050.0268.42
5.1.20.0030.0288.44
5.1.10.0020.0288.17
5.1.00.0040.0288.16
5.0.50.0040.0216.66
5.0.40.0070.0176.52
5.0.30.0040.0316.33
5.0.20.0010.0236.30
5.0.10.0040.0206.28
5.0.00.0030.0316.27
4.4.90.0040.0154.78
4.4.80.0030.0164.75
4.4.70.0030.0164.76
4.4.60.0050.0144.75
4.4.50.0030.0164.77
4.4.40.0050.0244.71
4.4.30.0010.0184.76
4.4.20.0020.0174.84
4.4.10.0040.0154.84
4.4.00.0020.0254.76
4.3.110.0030.0154.67
4.3.100.0010.0164.66
4.3.90.0040.0144.63
4.3.80.0020.0254.58
4.3.70.0010.0174.63
4.3.60.0040.0144.63
4.3.50.0010.0194.63
4.3.40.0050.0224.53
4.3.30.0050.0153.30
4.3.20.0030.0173.28
4.3.10.0030.0173.24
4.3.00.0000.0337.34

preferences:
43.42 ms | 401 KiB | 5 Q