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] . '-' . $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.0110.00316.61
8.3.50.0100.01018.06
8.3.40.0090.00618.95
8.3.30.0120.00619.40
8.3.20.0040.00420.16
8.3.10.0080.00021.71
8.3.00.0080.00417.75
8.2.180.0100.00616.50
8.2.170.0070.00722.96
8.2.160.0100.00320.43
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00322.25
8.2.110.0060.00322.02
8.2.100.0000.01220.07
8.2.90.0040.00719.34
8.2.80.0000.00817.97
8.2.70.0040.00417.63
8.2.60.0030.00518.05
8.2.50.0080.00018.07
8.2.40.0090.00020.07
8.2.30.0050.00520.03
8.2.20.0060.00317.95
8.2.10.0070.00018.13
8.2.00.0040.00418.00
8.1.270.0050.00322.01
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00323.92
8.1.230.0070.00419.15
8.1.220.0040.00417.76
8.1.210.0000.00818.77
8.1.200.0000.01017.48
8.1.190.0080.00017.48
8.1.180.0080.00019.14
8.1.170.0030.00518.73
8.1.160.0000.00721.98
8.1.150.0030.00518.88
8.1.140.0000.00717.64
8.1.130.0070.00017.96
8.1.120.0050.00217.56
8.1.110.0070.00017.71
8.1.100.0000.00817.67
8.1.90.0050.00217.56
8.1.80.0040.00417.71
8.1.70.0030.00317.64
8.1.60.0060.00317.68
8.1.50.0000.00817.52
8.1.40.0080.00017.57
8.1.30.0030.00617.66
8.1.20.0000.00817.78
8.1.10.0040.00417.66
8.1.00.0030.00617.67
8.0.300.0040.00419.21
8.0.290.0040.00417.05
8.0.280.0030.00518.45
8.0.270.0030.00317.34
8.0.260.0030.00317.22
8.0.250.0030.00317.16
8.0.240.0040.00417.09
8.0.230.0000.00717.15
8.0.220.0000.00816.98
8.0.210.0020.00517.08
8.0.200.0000.00716.99
8.0.190.0060.00317.05
8.0.180.0000.00717.18
8.0.170.0000.00817.08
8.0.160.0000.00717.09
8.0.150.0050.00217.15
8.0.140.0030.00617.12
8.0.130.0000.00613.51
8.0.120.0060.00317.05
8.0.110.0050.00217.10
8.0.100.0040.00416.98
8.0.90.0000.00717.14
8.0.80.0120.00617.11
8.0.70.0070.00016.88
8.0.60.0050.00317.10
8.0.50.0040.00417.16
8.0.30.0070.01217.14
8.0.20.0100.00817.40
8.0.10.0070.00017.04
8.0.00.0110.00817.06
7.4.330.0050.00015.21
7.4.320.0000.00816.57
7.4.300.0030.00316.70
7.4.290.0000.00716.64
7.4.280.0030.00316.75
7.4.270.0030.00516.66
7.4.260.0000.00816.50
7.4.250.0000.00916.59
7.4.240.0020.00516.78
7.4.230.0040.00416.49
7.4.220.0130.01316.72
7.4.210.0070.01116.70
7.4.200.0040.00416.58
7.4.190.0000.00716.87
7.4.160.0120.00816.77
7.4.150.0070.01017.40
7.4.140.0070.01017.86
7.4.130.0120.00716.69
7.4.120.0050.01416.75
7.4.110.0140.00716.81
7.4.100.0170.00416.74
7.4.90.0070.01116.70
7.4.80.0120.00619.39
7.4.70.0110.01116.82
7.4.60.0050.01116.72
7.4.50.0040.00416.42
7.4.40.0100.00716.66
7.4.30.0090.00916.61
7.4.00.0030.01415.12
7.3.330.0000.00613.26
7.3.320.0020.00213.52
7.3.310.0000.00716.50
7.3.300.0030.00316.46
7.3.290.0070.00716.43
7.3.280.0110.00916.46
7.3.270.0100.00717.40
7.3.260.0070.01716.81
7.3.250.0090.00916.68
7.3.240.0060.01016.56
7.3.230.0060.01016.88
7.3.210.0070.01016.66
7.3.200.0000.02319.39
7.3.190.0100.00716.71
7.3.180.0100.01416.40
7.3.170.0060.00916.73
7.3.160.0030.01216.53
7.3.120.0040.01315.13
7.3.110.0040.01415.20
7.3.100.0040.01115.11
7.3.90.0000.01414.77
7.3.80.0070.01014.91
7.3.70.0110.00014.93
7.3.60.0120.00315.05
7.3.50.0070.01014.95
7.3.40.0040.01014.77
7.3.30.0060.00315.05
7.3.20.0070.00716.93
7.3.10.0090.00616.86
7.3.00.0030.01016.98
7.2.330.0070.01016.93
7.2.320.0090.01217.00
7.2.310.0110.01116.92
7.2.300.0060.01017.00
7.2.290.0060.01616.82
7.2.250.0170.00315.28
7.2.240.0130.00315.25
7.2.230.0000.01015.21
7.2.220.0060.00615.33
7.2.210.0030.00915.29
7.2.200.0070.00315.27
7.2.190.0090.00915.14
7.2.180.0030.00615.33
7.2.170.0040.01115.36
7.2.60.0070.00717.02
7.2.00.0030.00919.71
7.1.330.0040.01116.01
7.1.320.0080.00515.98
7.1.310.0060.00616.03
7.1.300.0090.00916.05
7.1.290.0030.00915.98
7.1.280.0030.01015.96
7.1.270.0080.00016.05
7.1.260.0040.00815.80
7.1.200.0040.00816.09
7.1.100.0060.00618.33
7.1.70.0030.00517.38
7.1.60.0070.01719.46
7.1.50.0070.01016.99
7.1.00.0030.07722.34
7.0.200.0000.00916.97
7.0.140.0070.07021.97
7.0.110.0600.04019.98
7.0.100.0600.08019.89
7.0.90.0370.07719.94
7.0.80.0600.05320.07
7.0.70.0530.04319.99
7.0.60.0270.04320.03
7.0.50.0300.04319.89
7.0.40.0030.04019.85
7.0.30.0030.08019.78
7.0.20.0130.06319.74
7.0.10.0030.04319.70
7.0.00.0070.05719.74
5.6.280.0000.07721.13
5.6.260.0000.05020.89
5.6.250.0070.07720.74
5.6.240.0070.08320.48
5.6.230.0070.05720.68
5.6.220.0030.04020.55
5.6.210.0000.04320.73
5.6.200.0070.03720.68
5.6.190.0030.04020.65
5.6.180.0070.03720.59
5.6.170.0100.05720.70
5.6.160.0000.04320.68
5.6.150.0030.06020.46
5.6.140.0070.03720.55
5.6.130.0070.03720.85
5.6.120.0100.03720.85
5.6.110.0100.06320.64
5.6.100.0200.07720.67
5.6.90.0100.08020.57
5.6.80.0170.06019.86
5.6.70.0100.07320.01
5.6.60.0100.08020.07
5.6.50.0100.08020.06
5.6.40.0070.08320.02
5.6.30.0070.07720.00
5.6.20.0070.06319.82
5.6.10.0130.06719.93
5.6.00.0070.07720.01
5.5.380.0000.04320.52
5.5.370.0070.04020.47
5.5.360.0070.03720.32
5.5.350.0000.06020.47
5.5.340.0030.04020.81
5.5.330.0070.04020.99
5.5.320.0030.04020.79
5.5.310.0100.03320.74
5.5.300.0070.03320.81
5.5.290.0070.03720.70
5.5.280.0030.07020.84
5.5.270.0130.08020.74
5.5.260.0030.08320.75
5.5.250.0100.08320.69
5.5.240.0100.07020.41
5.5.230.0000.09020.19
5.5.220.0200.06320.26
5.5.210.0070.07020.19
5.5.200.0070.08020.16
5.5.190.0070.05720.09
5.5.180.0070.08020.32
5.5.160.0100.04720.14
5.5.150.0030.09020.30
5.5.140.0070.05320.36
5.5.130.0030.07720.30
5.5.120.0100.07320.32
5.5.110.0070.07720.29
5.5.100.0030.08720.21
5.5.90.0000.08019.98
5.5.80.0070.08019.98
5.5.70.0130.06020.03
5.5.60.0100.07320.16
5.5.50.0130.07020.15
5.5.40.0000.08020.03
5.5.30.0030.07720.19
5.5.20.0170.07020.13
5.5.10.0030.08020.04
5.5.00.0070.08019.92
5.4.450.0030.06719.50
5.4.440.0030.06019.32
5.4.430.0030.08019.58
5.4.420.0130.06319.34
5.4.410.0000.08719.30
5.4.400.0100.07319.34
5.4.390.0100.07318.98
5.4.380.0070.06319.18
5.4.370.0170.07019.16
5.4.360.0000.08719.27
5.4.350.0070.07719.24
5.4.340.0130.04019.18
5.4.320.0100.07719.18
5.4.310.0070.07719.18
5.4.300.0000.07718.98
5.4.290.0030.07319.23
5.4.280.0070.07319.16
5.4.270.0170.06019.01
5.4.260.0070.08019.00
5.4.250.0070.04319.17
5.4.240.0170.06319.01
5.4.230.0070.04018.95
5.4.220.0100.07318.97
5.4.210.0030.07019.00
5.4.200.0100.05319.33
5.4.190.0170.06319.17
5.4.180.0070.08018.94
5.4.170.0130.06319.23
5.4.160.0070.08019.15
5.4.150.0130.06719.14
5.4.140.0070.07716.44
5.4.130.0030.06716.66
5.4.120.0030.07316.36
5.4.110.0130.06716.47
5.4.100.0100.06716.57
5.4.90.0100.06716.38
5.4.80.0070.07316.45
5.4.70.0100.04716.41
5.4.60.0070.06316.39
5.4.50.0070.07316.33
5.4.40.0100.07016.49
5.4.30.0070.07016.48
5.4.20.0030.07716.54
5.4.10.0070.07016.49
5.4.00.0130.06716.04
5.3.290.0030.07714.69
5.3.280.0030.04314.57
5.3.270.0030.05714.83
5.3.260.0070.06714.56
5.3.250.0030.08014.73
5.3.240.0130.07014.61
5.3.230.0030.08014.45
5.3.220.0070.07714.64
5.3.210.0070.07714.79
5.3.200.0030.08014.56
5.3.190.0100.05314.43
5.3.180.0030.06714.69
5.3.170.0070.07714.70
5.3.160.0000.07714.57
5.3.150.0070.07314.64
5.3.140.0130.07014.53
5.3.130.0100.06714.40
5.3.120.0100.07014.55
5.3.110.0070.07714.55
5.3.100.0000.04714.13
5.3.90.0100.07014.11
5.3.80.0130.06314.10
5.3.70.0100.04314.25
5.3.60.0070.07314.14
5.3.50.0000.07713.96
5.3.40.0030.07713.90
5.3.30.0130.06713.76
5.3.20.0130.06713.64
5.3.10.0100.06313.80
5.3.00.0030.04313.86
5.2.170.0100.05712.09
5.2.160.0100.06012.09
5.2.150.0070.06312.09
5.2.140.0070.06012.09
5.2.130.0030.06312.09
5.2.120.0070.03712.09
5.2.110.0070.06012.09
5.2.100.0070.05712.09
5.2.90.0170.04312.09
5.2.80.0070.06012.09
5.2.70.0070.06312.09
5.2.60.0030.06312.09
5.2.50.0070.05312.09
5.2.40.0030.06012.09
5.2.30.0070.06012.09
5.2.20.0030.05312.09
5.2.10.0000.06712.09
5.2.00.0070.05312.09
5.1.60.0000.04712.09
5.1.50.0070.05012.09
5.1.40.0030.05712.09
5.1.30.0030.04712.09
5.1.20.0100.05012.09
5.1.10.0070.05012.09
5.1.00.0030.05312.09
5.0.50.0030.05012.09
5.0.40.0000.04312.09
5.0.30.0000.07012.09
5.0.20.0030.03712.09
5.0.10.0030.04312.09
5.0.00.0000.07012.09
4.4.90.0000.03312.09
4.4.80.0030.02712.09
4.4.70.0030.03312.09
4.4.60.0030.03712.09
4.4.50.0030.03312.09
4.4.40.0070.04712.09
4.4.30.0030.03712.09
4.4.20.0030.03712.09
4.4.10.0070.03312.09
4.4.00.0000.05312.09
4.3.110.0000.03712.09
4.3.100.0070.02312.09
4.3.90.0000.03712.09
4.3.80.0000.05312.09
4.3.70.0030.03312.09
4.3.60.0030.03712.09
4.3.50.0070.01312.09
4.3.40.0000.04312.09
4.3.30.0000.04012.09
4.3.20.0070.03012.09
4.3.10.0000.03712.09
4.3.00.0030.03312.09

preferences:
65.43 ms | 400 KiB | 5 Q