3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
7.3.0rc40.0240.00798.97
7.3.0rc30.0090.01216.34
7.3.0beta10.0000.00813.12
7.3.0alpha10.0040.00412.73
7.2.60.0210.00016.96
7.2.00.0040.01519.64
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