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-35'; $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.0110.00716.63
8.3.50.0090.01122.18
8.3.40.0120.00918.95
8.3.30.0070.00719.03
8.3.20.0040.00420.34
8.3.10.0070.00723.61
8.3.00.0030.00717.84
8.2.180.0070.01416.50
8.2.170.0060.00922.96
8.2.160.0130.00320.20
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0080.00022.26
8.2.110.0000.01022.24
8.2.100.0120.00020.07
8.2.90.0000.01019.07
8.2.80.0060.00317.97
8.2.70.0040.00417.88
8.2.60.0030.00717.89
8.2.50.0030.00518.07
8.2.40.0040.00420.20
8.2.30.0080.00318.26
8.2.20.0000.00817.93
8.2.10.0030.00618.27
8.2.00.0040.00417.90
8.1.280.0160.00625.92
8.1.270.0080.00023.62
8.1.260.0000.00926.35
8.1.250.0080.00028.09
8.1.240.0040.00423.92
8.1.230.0070.00319.07
8.1.220.0080.00017.80
8.1.210.0000.00818.77
8.1.200.0040.00417.47
8.1.190.0040.00417.48
8.1.180.0060.00319.26
8.1.170.0040.00418.84
8.1.160.0080.00022.07
8.1.150.0040.00418.83
8.1.140.0020.00517.56
8.1.130.0040.00417.96
8.1.120.0070.00017.70
8.1.110.0050.00317.70
8.1.100.0070.00017.66
8.1.90.0030.00417.70
8.1.80.0050.00317.63
8.1.70.0000.00817.53
8.1.60.0060.00317.70
8.1.50.0000.00817.55
8.1.40.0000.00717.61
8.1.30.0000.00817.71
8.1.20.0020.00517.78
8.1.10.0060.00317.73
8.1.00.0040.00417.68
8.0.300.0040.00418.77
8.0.290.0040.00317.30
8.0.280.0030.00318.42
8.0.270.0030.00317.40
8.0.260.0000.00717.34
8.0.250.0030.00317.02
8.0.240.0000.00717.18
8.0.230.0030.00317.03
8.0.220.0000.00717.12
8.0.210.0070.00017.09
8.0.200.0000.00817.19
8.0.190.0080.00017.13
8.0.180.0060.00317.00
8.0.170.0000.00717.12
8.0.160.0040.00416.97
8.0.150.0000.00716.93
8.0.140.0040.00417.12
8.0.130.0030.00313.52
8.0.120.0030.00517.07
8.0.110.0070.00017.00
8.0.100.0040.00417.14
8.0.90.0040.00417.14
8.0.80.0070.01417.05
8.0.70.0040.00417.00
8.0.60.0070.00017.01
8.0.50.0000.00717.18
8.0.30.0110.00817.26
8.0.20.0140.00617.40
8.0.10.0000.00817.07
8.0.00.0070.01117.04
7.4.330.0060.00015.14
7.4.320.0040.00416.79
7.4.300.0030.00316.74
7.4.290.0030.00516.61
7.4.280.0000.00716.72
7.4.270.0070.00016.59
7.4.260.0030.00316.62
7.4.250.0030.00716.60
7.4.240.0040.00316.65
7.4.230.0000.00716.60
7.4.220.0120.00616.70
7.4.210.0050.00916.62
7.4.200.0000.00716.82
7.4.190.0030.00316.75
7.4.160.0100.00516.51
7.4.150.0030.01417.40
7.4.140.0100.00917.86
7.4.130.0110.00916.71
7.4.120.0110.00516.64
7.4.110.0120.00416.57
7.4.100.0150.00316.66
7.4.90.0030.01516.71
7.4.80.0210.00019.39
7.4.70.0130.01016.69
7.4.60.0090.00616.53
7.4.50.0000.00816.70
7.4.40.0110.00716.53
7.4.30.0080.00816.55
7.4.00.0100.00315.04
7.3.330.0050.00013.49
7.3.320.0000.00513.36
7.3.310.0000.00716.62
7.3.300.0060.00016.38
7.3.290.0090.00616.44
7.3.280.0120.00716.44
7.3.270.0100.00717.40
7.3.260.0060.01116.44
7.3.250.0130.00716.72
7.3.240.0070.01016.72
7.3.230.0130.00316.57
7.3.210.0040.01516.63
7.3.200.0090.01019.39
7.3.190.0110.01116.77
7.3.180.0080.00816.44
7.3.170.0100.00616.71
7.3.160.0030.01316.64
7.3.120.0030.01316.90
7.3.110.0090.00616.90
7.3.100.0110.00316.90
7.3.90.0100.00716.90
7.3.80.0080.00816.90
7.3.70.0090.00916.90
7.3.60.0080.00816.90
7.3.50.0070.01016.90
7.3.40.0040.01116.90
7.3.30.0080.00416.90
7.3.20.0040.00716.90
7.3.10.0110.00016.90
7.3.00.0070.00316.90
7.2.330.0120.00616.97
7.2.320.0110.01116.51
7.2.310.0080.00816.73
7.2.300.0110.00517.00
7.2.290.0100.01616.76
7.2.240.0070.00716.90
7.2.230.0000.01716.90
7.2.220.0040.01416.90
7.2.210.0040.01116.90
7.2.200.0000.01516.90
7.2.190.0090.00616.90
7.2.180.0090.00616.90
7.2.170.0040.01216.90
7.2.160.0070.01116.90
7.2.150.0070.01117.11
7.2.140.0070.01017.17
7.2.130.0130.00316.90
7.2.120.0080.00616.97
7.2.110.0100.00516.87
7.2.100.0050.01116.95
7.2.90.0080.00917.06
7.2.80.0110.00816.95
7.2.70.0100.00817.06
7.2.60.0080.00817.01
7.2.50.0080.00616.98
7.2.40.0110.00517.01
7.2.30.0090.00816.97
7.2.20.0120.00616.96
7.2.10.0050.01116.99
7.2.00.0090.00817.75
7.1.330.0070.01016.90
7.1.320.0000.01416.90
7.1.310.0030.00716.90
7.1.300.0090.00616.90
7.1.290.0000.01616.90
7.1.280.0080.00816.90
7.1.270.0080.00816.90
7.1.260.0070.01116.90
7.1.250.0000.01616.90
7.1.240.0080.00815.86
7.1.230.0090.00616.02
7.1.220.0110.00515.85
7.1.210.0070.00715.90
7.1.200.0050.00715.84
7.1.190.0060.00915.93
7.1.180.0090.00315.93
7.1.170.0140.00415.76
7.1.160.0070.00715.97
7.1.150.0080.00816.03
7.1.140.0130.00516.02
7.1.130.0030.01015.74
7.1.120.0100.00316.08
7.1.110.0110.00516.12
7.1.100.0050.00917.04
7.1.90.0100.00316.04
7.1.80.0130.00016.14
7.1.70.0070.00416.73
7.1.60.0130.00717.62
7.1.50.0080.01316.50
7.1.40.0160.00015.79
7.1.30.0140.00515.73
7.1.20.0120.00316.15
7.1.10.0030.00915.82
7.1.00.0060.04119.17
7.0.320.0060.01015.43
7.0.310.0080.00815.32
7.0.300.0110.00015.44
7.0.290.0120.00315.53
7.0.280.0060.00915.40
7.0.270.0110.00315.67
7.0.260.0080.00815.63
7.0.250.0150.00215.65
7.0.240.0000.01415.67
7.0.230.0070.00715.66
7.0.220.0130.00315.59
7.0.210.0050.00515.52
7.0.200.0070.00516.31
7.0.190.0070.00715.62
7.0.180.0090.00615.61
7.0.170.0070.00415.64
7.0.160.0100.00515.32
7.0.150.0110.00015.49
7.0.140.0070.03818.76
7.0.130.0140.00015.39
7.0.120.0130.00015.48
7.0.110.0120.00315.55
7.0.100.0070.00715.39
7.0.90.0170.00015.47
7.0.80.0160.00315.58
7.0.70.0060.01315.79
7.0.60.0070.02617.86
7.0.50.0030.03316.86
7.0.40.0090.02116.76
7.0.30.0200.03516.77
7.0.20.0160.03016.80
7.0.10.0100.04316.98
7.0.00.0090.04116.85
5.6.380.0100.00314.55
5.6.370.0060.00914.14
5.6.360.0050.00914.53
5.6.350.0130.00414.70
5.6.340.0160.00014.69
5.6.330.0100.00514.68
5.6.320.0060.00914.85
5.6.310.0110.00314.84
5.6.300.0090.00314.64
5.6.290.0090.00514.56
5.6.280.0050.04117.70
5.6.270.0120.00014.62
5.6.260.0110.00414.32
5.6.250.0120.00314.59
5.6.240.0070.01114.72
5.6.230.0120.00414.59
5.6.220.0100.00514.47
5.6.210.0070.03217.69
5.6.200.0070.03416.27
5.6.190.0120.03417.62
5.6.180.0130.02017.51
5.6.170.0180.02917.46
5.6.160.0060.03817.39
5.6.150.0120.02716.38
5.6.140.0100.03816.35
5.6.130.0090.04516.36
5.6.120.0100.02817.81
5.6.110.0180.03517.81
5.6.100.0100.04317.88
5.6.90.0100.04517.83
5.6.80.0100.02117.48
5.6.70.0130.00414.12
5.6.60.0130.00314.30
5.6.50.0190.00014.63
5.6.40.0070.00714.32
5.6.30.0070.00714.50
5.6.20.0060.00814.73
5.6.10.0130.00314.30
5.6.00.0070.01114.67
5.5.380.0070.00711.51
5.5.370.0100.00311.65
5.5.360.0000.01111.27
5.5.350.2000.02115.88
5.5.340.0050.02714.72
5.5.330.0090.04516.05
5.5.320.0130.02515.81
5.5.310.0240.03215.82
5.5.300.0120.02314.69
5.5.290.0030.03614.76
5.5.280.0060.02516.08
5.5.270.0100.03816.04
5.5.260.0130.04216.09
5.5.250.0090.02315.87
5.5.240.0100.03515.77
5.5.230.0160.00011.31
5.5.220.0070.00411.27
5.5.210.0080.00011.46
5.5.200.0050.00811.47
5.5.190.0100.00311.47
5.5.180.0110.00411.34
5.5.170.0080.00614.16
5.5.160.0110.00611.31
5.5.150.0090.00411.27
5.5.140.0090.00411.27
5.5.130.0120.00311.27
5.5.120.0080.00511.34
5.5.110.0120.00311.39
5.5.100.0070.00511.51
5.5.90.0080.00011.27
5.5.80.0100.00411.27
5.5.70.0080.00811.27
5.5.60.0100.00511.27
5.5.50.0080.00811.39
5.5.40.0070.00411.41
5.5.30.0110.00411.39
5.5.20.0030.00911.29
5.5.10.0080.00411.30
5.5.00.0080.00611.27
5.4.450.0160.03315.51
5.4.440.0100.03715.44
5.4.430.0100.03815.43
5.4.420.0110.03515.21
5.4.410.0070.03715.35
5.4.400.0200.03315.23
5.4.390.0180.03515.26
5.4.380.0150.03815.06
5.4.370.0150.03614.93
5.4.360.0120.02815.09
5.4.350.0170.03514.90
5.4.340.0090.03815.03
5.4.330.0070.00711.32
5.4.320.0070.02211.89
5.4.310.0040.02511.89
5.4.300.0090.01911.95
5.4.290.0080.02011.88
5.4.280.0080.02011.83
5.4.270.0060.02211.83
5.4.260.0080.02111.83
5.4.250.0120.02111.83
5.4.240.0070.02011.83
5.4.230.0090.02211.83
5.4.220.0070.02011.83
5.4.210.0080.02011.84
5.4.200.0050.02311.83
5.4.190.0050.02311.90
5.4.180.0080.02511.83
5.4.170.0060.02211.83
5.4.160.0060.02411.83
5.4.150.0080.02211.83
5.4.140.0050.02411.76
5.4.130.0080.02211.67
5.4.120.0060.01911.64
5.4.110.0050.02211.64
5.4.100.0030.02311.80
5.4.90.0080.01911.70
5.4.80.0030.02511.73
5.4.70.0070.01911.68
5.4.60.0080.01711.66
5.4.50.0070.01811.68
5.4.40.0080.01911.69
5.4.30.0080.02011.67
5.4.20.0070.01911.66
5.4.10.0060.02111.63
5.4.00.0070.02411.39
5.3.290.0040.02912.04
5.3.280.0080.02411.99
5.3.270.0060.02212.00
5.3.260.0090.02012.00
5.3.250.0080.02111.99
5.3.240.0080.02312.00
5.3.230.0070.02311.99
5.3.220.0080.01911.98
5.3.210.0080.02011.98
5.3.200.0050.02411.97
5.3.190.0060.02111.97
5.3.180.0110.01611.97
5.3.170.0100.01811.97
5.3.160.0030.02211.97
5.3.150.0050.02211.97
5.3.140.0060.02411.96
5.3.130.0100.01911.96
5.3.120.0060.02311.96
5.3.110.0080.02211.96
5.3.100.0080.02011.70
5.3.90.0080.01911.69
5.3.80.0080.02011.68
5.3.70.0020.02511.68
5.3.60.0070.02011.67
5.3.50.0080.01911.65
5.3.40.0070.02211.65
5.3.30.0090.01811.63
5.3.20.0080.01911.52
5.3.10.0080.01911.50
5.3.00.0070.01911.50
5.2.170.0070.02310.25
5.2.160.0080.01610.25
5.2.150.0060.02010.25
5.2.140.0030.02110.25
5.2.130.0050.01710.23
5.2.120.0080.01510.23
5.2.110.0050.01710.23
5.2.100.0070.01610.22
5.2.90.0070.01610.22
5.2.80.0090.01710.22
5.2.70.0040.02410.22
5.2.60.0050.01810.20
5.2.50.0030.02010.19
5.2.40.0050.01810.17
5.2.30.0060.01710.16
5.2.20.0030.01910.16
5.2.10.0050.02310.11
5.2.00.0050.01710.04
5.1.60.0020.0169.68
5.1.50.0060.0139.68
5.1.40.0060.0139.67
5.1.30.0060.0149.84
5.1.20.0060.0169.86
5.1.10.0050.0159.72
5.1.00.0060.0139.72
5.0.50.0040.0138.96
5.0.40.0070.0098.89
5.0.30.0050.0168.80
5.0.20.0050.0128.78
5.0.10.0020.0168.77
5.0.00.0050.0178.77
4.4.90.0010.0108.02
4.4.80.0010.0148.01
4.4.70.0060.0088.01
4.4.60.0030.0108.01
4.4.50.0030.0098.02
4.4.40.0030.0147.99
4.4.30.0010.0128.01
4.4.20.0040.0098.06
4.4.10.0020.0118.06
4.4.00.0030.0158.02
4.3.110.0030.0107.97
4.3.100.0030.0097.97
4.3.90.0040.0127.95
4.3.80.0040.0177.92
4.3.70.0040.0107.95
4.3.60.0050.0117.95
4.3.50.0040.0117.95
4.3.40.0060.0127.90
4.3.30.0010.0127.29
4.3.20.0020.0117.27
4.3.10.0050.0087.26
4.3.00.0070.0159.30

preferences:
45.26 ms | 401 KiB | 5 Q