3v4l.org

run code in 300+ PHP versions simultaneously
<?php function calculate_birth_year($age, $day_month_string) { $now = new DateTime("now", new DateTimeZone('America/New_York')); if (preg_match('#^([0-9]+) ([a-z]+)$#', $day_month_string)) { $dt = new DateTime($day_month_string, new DateTimeZone('America/New_York')); if ($dt > $now) { ++$age; } return $dt->modify("$age years ago")->format('Y'); } else return false; } echo calculate_birth_year('34', '7 dec');

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.0150.00617.25
8.3.50.0100.00718.37
8.3.40.0120.00319.01
8.3.30.0110.00419.09
8.3.20.0080.00020.33
8.3.10.0040.00422.09
8.3.00.0050.00323.64
8.2.180.0130.00918.91
8.2.170.0070.01122.96
8.2.160.0040.01119.58
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00419.38
8.2.120.0000.00726.35
8.2.110.0070.00721.24
8.2.100.0090.00318.08
8.2.90.0050.00318.28
8.2.80.0030.00618.05
8.2.70.0030.00618.05
8.2.60.0000.00818.16
8.2.50.0040.00718.28
8.2.40.0080.00020.67
8.2.30.0040.00421.28
8.2.20.0040.00418.42
8.2.10.0000.00718.31
8.2.00.0040.00418.26
8.1.280.0120.00325.92
8.1.270.0000.00822.39
8.1.260.0050.00326.35
8.1.250.0050.00228.09
8.1.240.0140.00323.96
8.1.230.0080.00422.81
8.1.220.0040.00417.91
8.1.210.0050.00318.77
8.1.200.0000.00917.86
8.1.190.0040.00417.72
8.1.180.0000.00818.10
8.1.170.0030.00619.03
8.1.160.0040.00419.08
8.1.150.0000.00720.26
8.1.140.0070.00019.76
8.1.130.0000.00719.20
8.1.120.0000.00717.90
8.1.110.0030.00617.97
8.1.100.0000.00817.92
8.1.90.0080.00017.91
8.1.80.0070.00017.82
8.1.70.0000.00717.86
8.1.60.0000.00817.83
8.1.50.0050.00317.88
8.1.40.0000.00817.86
8.1.30.0030.00518.06
8.1.20.0030.00517.91
8.1.10.0040.00417.94
8.1.00.0060.00317.83
8.0.300.0030.00621.76
8.0.290.0030.00617.13
8.0.280.0000.00718.54
8.0.270.0000.00717.33
8.0.260.0030.00318.66
8.0.250.0030.00317.27
8.0.240.0100.00017.37
8.0.230.0030.00317.30
8.0.220.0050.00317.20
8.0.210.0030.00317.29
8.0.200.0000.01017.24
8.0.190.0050.00317.25
8.0.180.0030.00617.30
8.0.170.0030.00517.39
8.0.160.0070.00017.33
8.0.150.0000.00817.14
8.0.140.0000.00917.29
8.0.130.0030.00313.73
8.0.120.0000.00717.18
8.0.110.0040.00417.36
8.0.100.0000.00717.18
8.0.90.0040.00417.28
8.0.80.0090.00817.25
8.0.70.0020.00517.29
8.0.60.0040.00417.23
8.0.50.0040.00417.23
8.0.30.0080.00817.53
8.0.20.0100.01117.50
8.0.10.0000.00817.31
8.0.00.0150.00317.26
7.4.330.0060.00015.55
7.4.320.0060.00017.00
7.4.300.0050.00217.00
7.4.290.0030.00316.94
7.4.280.0080.00016.91
7.4.270.0040.00416.92
7.4.260.0040.00416.87
7.4.250.0030.00716.99
7.4.240.0080.00016.93
7.4.230.0000.00816.91
7.4.220.0090.00916.95
7.4.210.0060.01517.11
7.4.200.0040.00416.83
7.4.160.0070.00916.94
7.4.150.0200.00317.40
7.4.140.0090.01117.86
7.4.130.0070.01016.95
7.4.120.0130.00516.93
7.4.110.0070.01016.84
7.4.100.0030.01316.99
7.4.90.0060.01117.13
7.4.80.0110.00719.39
7.4.70.0080.01617.09
7.4.60.0140.00416.99
7.4.50.0050.01117.00
7.4.40.0060.01216.84
7.4.30.0070.01016.88
7.4.10.0060.01315.37
7.4.00.0060.01215.44
7.3.330.0000.00513.72
7.3.320.0000.00513.58
7.3.310.0050.00316.63
7.3.300.0030.00316.74
7.3.290.0110.00516.68
7.3.280.0090.00716.73
7.3.270.0060.01217.40
7.3.260.0210.01916.96
7.3.250.0090.00816.81
7.3.240.0110.00716.81
7.3.230.0070.01017.15
7.3.210.0100.01316.72
7.3.200.0070.01016.73
7.3.190.0090.00916.77
7.3.180.0130.00316.76
7.3.170.0060.00916.88
7.3.160.0150.00316.97
7.3.130.0110.00615.21
7.3.120.0060.01415.35
7.3.110.0060.01315.20
7.3.100.0060.01015.41
7.3.90.0050.00815.42
7.3.80.0050.00815.27
7.3.70.0060.00815.21
7.3.60.0050.00715.20
7.3.50.0090.00515.24
7.3.40.0080.00715.30
7.3.30.0020.01215.38
7.3.20.0080.00717.05
7.3.10.0050.00717.01
7.3.00.0100.00717.05
7.2.330.0100.01417.04
7.2.320.0100.01016.98
7.2.310.0070.01017.05
7.2.300.0140.00617.24
7.2.290.0090.00916.99
7.2.260.0130.00615.53
7.2.250.0030.01615.62
7.2.240.0060.01115.39
7.2.230.0090.00615.31
7.2.220.0030.01115.44
7.2.210.0090.00315.65
7.2.200.0060.00815.46
7.2.190.0060.00615.24
7.2.180.0050.00815.38
7.2.170.0060.01115.55
7.2.160.0020.01115.28
7.2.150.0090.00317.28
7.2.140.0050.00617.37
7.2.130.0100.00517.32
7.2.120.0050.01017.32
7.2.110.0120.00517.25
7.2.100.0070.00817.28
7.2.90.0070.00917.26
7.2.80.0040.01217.31
7.2.70.0080.00817.27
7.2.60.0060.00917.36
7.2.50.0070.00817.25
7.2.40.0100.00717.28
7.2.30.0070.01017.26
7.2.20.0100.00817.27
7.2.10.0040.01417.17
7.2.00.0090.00517.26
7.1.330.0050.01116.33
7.1.320.0040.01116.22
7.1.310.0060.00816.27
7.1.300.0040.00916.32
7.1.290.0060.01016.23
7.1.280.0050.00816.08
7.1.270.0020.01116.36
7.1.260.0050.00716.18
7.1.250.0080.00716.11
7.1.240.0080.00316.11
7.1.230.0030.01016.09
7.1.220.0070.00516.18
7.1.210.0050.00816.12
7.1.200.0100.00416.06
7.1.190.0050.00816.22
7.1.180.0060.00815.95
7.1.170.0060.00816.25
7.1.160.0050.00916.13
7.1.150.0050.00716.31
7.1.140.0050.00916.06
7.1.130.0020.01016.34
7.1.120.0100.00516.13
7.1.110.0030.01116.25
7.1.100.0050.00916.23
7.1.90.0520.00816.21
7.1.80.0470.00716.39
7.1.70.0570.00615.94
7.1.60.0790.00921.99
7.1.50.0590.00722.02
7.1.40.0610.00921.80
7.1.30.0120.00721.86
7.1.20.0090.01221.89
7.1.10.0060.00915.92
7.1.00.0040.01015.97
7.0.330.0080.00615.64
7.0.320.0040.01015.62
7.0.310.0060.01015.58
7.0.300.0060.00715.73
7.0.290.0070.00815.85
7.0.280.0110.00215.78
7.0.270.0080.00815.65
7.0.260.0100.00515.84
7.0.250.0050.00915.80
7.0.240.0050.00715.95
7.0.230.0420.00616.05
7.0.220.0410.00716.03
7.0.210.0570.00615.56
7.0.200.0580.00815.71
7.0.190.0660.01015.55
7.0.180.0580.00415.59
7.0.170.0060.00715.40
7.0.160.0060.00915.40
7.0.150.0140.00915.38
7.0.140.0710.00815.44
7.0.130.0280.00815.67
7.0.120.0070.00715.42
7.0.110.0180.01015.64
7.0.100.0090.00715.44
7.0.90.0110.00515.50
7.0.80.0050.00915.43
7.0.70.0190.00815.54
7.0.60.0050.00915.54
7.0.50.1030.00715.52
7.0.40.0760.00714.30
7.0.30.0190.00814.11
7.0.20.0340.00714.16
7.0.10.0070.00814.17
7.0.00.0090.01014.18
5.6.400.0060.00814.43
5.6.390.0040.00914.39
5.6.380.0050.01214.75
5.6.370.0100.00314.30
5.6.360.0050.00814.51
5.6.350.0060.00814.57
5.6.340.0030.00914.57
5.6.330.0020.01214.71
5.6.320.0050.00914.71
5.6.310.0080.00614.75
5.6.300.0040.00914.73
5.6.290.0050.00914.61
5.6.280.0030.01014.55
5.6.270.0070.00914.50
5.6.260.0080.00614.54
5.6.250.0060.00714.49
5.6.240.0080.00514.71
5.6.230.0060.01014.60
5.6.220.0070.00714.59
5.6.210.0070.01014.58
5.6.200.0080.00614.44
5.6.190.0090.00414.58
5.6.180.0100.00514.62
5.6.170.0060.00814.54
5.6.160.0030.01214.53
5.6.150.0090.00914.60
5.6.140.0080.00714.48
5.6.130.0090.00314.56
5.6.120.0080.00614.41
5.6.110.0120.00214.63
5.6.100.0070.00914.55
5.6.90.0040.00914.63
5.6.80.0000.01514.61
5.6.70.0050.00814.57
5.6.60.0050.01014.44
5.6.50.0080.00814.46
5.6.40.0020.01414.65
5.6.30.0060.00914.50
5.6.20.0080.00414.50
5.6.10.0020.01314.65
5.6.00.0080.00514.61

preferences:
77.41 ms | 400 KiB | 5 Q