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-34'; $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.40.0110.01119.04
8.3.30.0070.00719.21
8.3.20.0040.00420.33
8.3.10.0070.00021.95
8.3.00.0100.00017.63
8.2.170.0110.00422.96
8.2.160.0120.00320.53
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0000.00722.20
8.2.110.0080.00022.23
8.2.100.0110.00019.89
8.2.90.0050.00519.35
8.2.80.0060.00317.97
8.2.70.0040.00417.88
8.2.60.0040.00417.93
8.2.50.0090.00018.07
8.2.40.0000.00820.13
8.2.30.0060.00318.25
8.2.20.0000.00817.83
8.2.10.0070.00018.20
8.2.00.0060.00317.95
8.1.270.0050.00223.89
8.1.260.0030.00626.35
8.1.250.0000.00728.09
8.1.240.0060.00323.96
8.1.230.0080.00319.09
8.1.220.0040.00417.79
8.1.210.0000.00818.77
8.1.200.0000.00917.48
8.1.190.0040.00417.48
8.1.180.0000.00919.13
8.1.170.0000.00818.78
8.1.160.0000.00722.08
8.1.150.0070.00018.80
8.1.140.0040.00417.69
8.1.130.0070.00017.81
8.1.120.0030.00617.65
8.1.110.0040.00417.68
8.1.100.0070.00017.56
8.1.90.0040.00417.62
8.1.80.0000.00717.54
8.1.70.0070.00017.59
8.1.60.0080.00017.76
8.1.50.0000.00817.64
8.1.40.0040.00417.55
8.1.30.0040.00417.69
8.1.20.0030.00617.61
8.1.10.0000.00917.68
8.1.00.0040.00417.59
8.0.300.0040.00418.77
8.0.290.0000.00717.30
8.0.280.0040.00418.54
8.0.270.0030.00317.38
8.0.260.0000.00617.40
8.0.250.0000.00717.15
8.0.240.0000.00717.03
8.0.230.0030.00317.19
8.0.220.0000.00717.02
8.0.210.0030.00317.12
8.0.200.0030.00317.05
8.0.190.0000.00717.18
8.0.180.0070.00017.16
8.0.170.0030.00617.00
8.0.160.0000.00716.98
8.0.150.0040.00417.13
8.0.140.0030.00616.98
8.0.130.0060.00013.41
8.0.120.0030.00517.12
8.0.110.0000.00716.92
8.0.100.0030.00517.12
8.0.90.0040.00417.10
8.0.80.0160.00617.02
8.0.70.0030.00617.02
8.0.60.0070.00017.00
8.0.50.0030.00516.89
8.0.30.0110.00817.25
8.0.20.0080.01217.48
8.0.10.0000.00817.05
8.0.00.0130.00516.89
7.4.330.0020.00215.15
7.4.320.0000.00616.73
7.4.300.0030.00316.73
7.4.290.0040.00416.68
7.4.280.0000.00716.74
7.4.270.0040.00416.75
7.4.260.0030.00516.53
7.4.250.0000.00816.61
7.4.240.0050.00216.66
7.4.230.0070.00016.82
7.4.220.0060.01216.67
7.4.210.0050.00916.75
7.4.200.0070.00016.85
7.4.190.0070.00016.88
7.4.160.0100.01016.81
7.4.150.0110.00617.40
7.4.140.0100.01017.86
7.4.130.0130.00516.76
7.4.120.0090.01216.65
7.4.110.0120.00616.90
7.4.100.0120.00616.61
7.4.90.0090.00916.66
7.4.80.0120.00619.39
7.4.70.0120.00916.67
7.4.60.0100.01016.46
7.4.50.0000.00816.61
7.4.40.0100.00716.50
7.4.30.0140.00316.72
7.4.00.0080.00615.23
7.3.330.0050.00013.33
7.3.320.0000.00613.44
7.3.310.0000.00716.46
7.3.300.0070.00016.54
7.3.290.0060.01316.50
7.3.280.0110.00716.38
7.3.270.0110.01117.40
7.3.260.0070.01116.65
7.3.250.0070.01016.45
7.3.240.0030.01216.63
7.3.230.0100.00716.47
7.3.210.0090.01216.76
7.3.200.0070.01019.39
7.3.190.0140.00916.55
7.3.180.0110.01116.69
7.3.170.0140.00716.66
7.3.160.0080.00816.66
7.3.120.0080.00915.10
7.3.110.0060.01014.92
7.3.100.0110.00414.82
7.3.90.0070.00414.96
7.3.80.0030.01015.00
7.3.70.0030.00615.14
7.3.60.0040.01115.11
7.3.50.0040.01114.96
7.3.40.0090.00614.92
7.3.30.0060.00615.19
7.3.20.0030.01016.99
7.3.10.0100.00716.92
7.3.00.0070.00716.83
7.2.330.0120.00417.00
7.2.320.0040.01417.02
7.2.310.0090.00616.77
7.2.300.0100.00616.73
7.2.290.0200.00616.79
7.2.250.0080.00815.25
7.2.240.0070.01315.42
7.2.230.0030.01315.24
7.2.220.0040.00715.25
7.2.210.0000.01814.97
7.2.200.0070.00715.39
7.2.190.0060.00615.16
7.2.180.0030.01015.18
7.2.170.0000.01015.18
7.2.80.0060.00316.93
7.2.60.0030.00716.88
7.2.00.0030.01019.48
7.1.330.0120.00316.02
7.1.320.0030.00715.99
7.1.310.0070.01016.09
7.1.300.0120.00315.79
7.1.290.0090.00616.08
7.1.280.0000.01615.82
7.1.270.0100.00315.63
7.1.260.0080.00615.80
7.1.200.0000.01416.01
7.1.100.0080.00418.29
7.1.70.0030.01317.27
7.1.60.0060.01919.46
7.1.50.0070.01717.25
7.1.00.0000.08022.47
7.0.200.0060.00316.90
7.0.140.0000.07722.08
7.0.60.0130.05319.91
7.0.50.0030.09017.92
7.0.40.0070.08320.11
7.0.30.0230.04020.16
7.0.20.0270.07720.10
7.0.10.0000.05020.19
7.0.00.0200.07020.07
5.6.280.0070.06720.89
5.6.210.0130.06320.77
5.6.200.0070.07018.22
5.6.190.0130.07720.55
5.6.180.0130.08320.57
5.6.170.0170.06020.50
5.6.160.0030.07320.54
5.6.150.0100.08018.22
5.6.140.0100.06718.18
5.6.130.0030.04018.26
5.6.120.0000.04321.04
5.6.110.0070.05321.02
5.6.100.0100.07720.98
5.6.90.0070.07721.04
5.6.80.0130.07320.36
5.5.350.3030.03720.44
5.5.340.0130.06717.94
5.5.330.0030.04020.13
5.5.320.0200.04720.37
5.5.310.0270.04720.35
5.5.300.0030.04717.98
5.5.290.0030.06718.04
5.5.280.0100.03720.97
5.5.270.0070.07320.89
5.5.260.0030.07020.77
5.5.250.0100.06020.69
5.5.240.0130.06020.19
5.4.450.0170.05719.39
5.4.440.0270.05719.47
5.4.430.0270.07719.30
5.4.420.0230.07719.33
5.4.410.0270.04719.18
5.4.400.0130.06019.29
5.4.390.0130.06318.84
5.4.380.0070.06318.60
5.4.370.0070.06018.78
5.4.360.0200.04318.53
5.4.350.0100.06018.57
5.4.340.0100.05718.70
5.4.320.0090.04812.50
5.4.310.0060.03712.50
5.4.300.0120.05012.50
5.4.290.0070.03912.50
5.4.280.0040.03812.39
5.4.270.0080.03412.39
5.4.260.0080.03612.39
5.4.250.0090.03612.40
5.4.240.0060.03712.39
5.4.230.0030.04112.39
5.4.220.0060.03712.39
5.4.210.0070.03512.39
5.4.200.0050.03912.39
5.4.190.0070.03712.39
5.4.180.0060.03712.39
5.4.170.0060.03612.39
5.4.160.0050.03812.39
5.4.150.0100.04012.39
5.4.140.0040.04112.07
5.4.130.0070.04912.05
5.4.120.0120.03912.02
5.4.110.0070.04612.01
5.4.100.0100.05112.01
5.4.90.0090.04212.02
5.4.80.0060.05412.01
5.4.70.0060.04912.00
5.4.60.0120.04412.00
5.4.50.0120.04712.01
5.4.40.0080.04812.00
5.4.30.0080.04612.00
5.4.20.0160.05611.99
5.4.10.0090.03311.99
5.4.00.0060.03611.48
5.3.290.0070.05212.80
5.3.280.0080.03512.71
5.3.270.0040.04212.73
5.3.260.0080.05412.71
5.3.250.0070.05312.71
5.3.240.0070.04112.72
5.3.230.0050.04312.71
5.3.220.0050.03812.68
5.3.210.0060.03812.68
5.3.200.0080.03312.68
5.3.190.0070.03512.68
5.3.180.0070.03512.67
5.3.170.0050.03612.67
5.3.160.0040.03812.67
5.3.150.0080.03812.67
5.3.140.0100.03612.66
5.3.130.0080.03812.66
5.3.120.0060.03912.66
5.3.110.0050.03912.66
5.3.100.0070.03812.13
5.3.90.0050.03912.10
5.3.80.0080.03512.09
5.3.70.0060.03612.09
5.3.60.0090.03312.07
5.3.50.0070.03512.02
5.3.40.0080.03512.02
5.3.30.0040.05411.98
5.3.20.0080.03411.77
5.3.10.0050.03511.73
5.3.00.0070.03411.72
5.2.170.0050.0299.23
5.2.160.0040.0309.23
5.2.150.0050.0309.23
5.2.140.0040.0319.23
5.2.130.0030.0309.18
5.2.120.0030.0359.19
5.2.110.0080.0329.19
5.2.100.0040.0349.18
5.2.90.0040.0309.18
5.2.80.0020.0349.18
5.2.70.0040.0409.18
5.2.60.0060.0309.13
5.2.50.0080.0309.11
5.2.40.0040.0359.08
5.2.30.0070.0289.05
5.2.20.0100.0469.04
5.2.10.0060.0398.95
5.2.00.0030.0348.82
5.1.60.0080.0348.09
5.1.50.0040.0358.09
5.1.40.0060.0348.07
5.1.30.0030.0348.42
5.1.20.0030.0308.44
5.1.10.0030.0268.17
5.1.00.0030.0278.17
5.0.50.0020.0216.66
5.0.40.0040.0206.52
5.0.30.0070.0396.33
5.0.20.0080.0266.29
5.0.10.0040.0206.27
5.0.00.0060.0306.27
4.4.90.0040.0144.78
4.4.80.0040.0144.76
4.4.70.0030.0164.75
4.4.60.0010.0214.75
4.4.50.0040.0214.77
4.4.40.0040.0244.71
4.4.30.0040.0144.75
4.4.20.0050.0154.84
4.4.10.0050.0224.85
4.4.00.0020.0264.76
4.3.110.0030.0204.67
4.3.100.0040.0154.66
4.3.90.0050.0144.64
4.3.80.0020.0254.58
4.3.70.0040.0134.63
4.3.60.0030.0134.63
4.3.50.0030.0154.62
4.3.40.0020.0254.54
4.3.30.0020.0163.30
4.3.20.0040.0153.28
4.3.10.0010.0173.25
4.3.00.0100.0237.34

preferences:
43.01 ms | 400 KiB | 5 Q