3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('Europe/Berlin'); // birthdate format is YYYY-MM-DD $birth = new DateTime('1966-01-21'); $today = new DateTime('21-01-2011'); $diff = $birth->diff($today); echo $diff->format('%y') . PHP_EOL; // will output 45 $birth = new DateTime('1966-01-23'); $today = new DateTime('21-01-2011'); $diff = $birth->diff($today); echo $diff->format('%y') . PHP_EOL; // will output 45 wrongly $birth = new DateTime('1966-01-24'); // three days difference! $today = new DateTime('21-01-2011'); $diff = $birth->diff($today); echo $diff->format('%y') . PHP_EOL; // will output 44 - correct ?>

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.0040.01116.38
8.3.50.0100.00522.11
8.3.40.0060.00918.96
8.3.30.0160.00019.08
8.3.20.0000.00720.11
8.3.10.0040.00423.45
8.3.00.0040.00420.96
8.2.180.0000.01616.38
8.2.170.0040.01122.96
8.2.160.0100.01020.39
8.2.150.0030.00524.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00019.95
8.2.110.0060.00321.00
8.2.100.0040.00817.84
8.2.90.0000.00818.03
8.2.80.0050.00317.97
8.2.70.0000.00917.50
8.2.60.0090.00318.05
8.2.50.0040.00418.07
8.2.40.0000.00819.88
8.2.30.0070.00318.19
8.2.20.0040.00417.75
8.2.10.0040.00417.94
8.2.00.0000.00717.91
8.1.280.0070.01025.92
8.1.270.0050.00324.02
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0000.00922.61
8.1.230.0110.00021.04
8.1.220.0040.00417.74
8.1.210.0090.00018.96
8.1.200.0090.00017.47
8.1.190.0000.00817.48
8.1.180.0030.00618.10
8.1.170.0040.00418.78
8.1.160.0020.00522.03
8.1.150.0070.00018.74
8.1.140.0040.00417.64
8.1.130.0040.00417.90
8.1.120.0070.00017.71
8.1.110.0000.00817.70
8.1.100.0000.00717.54
8.1.90.0040.00417.66
8.1.80.0040.00417.66
8.1.70.0030.00517.64
8.1.60.0040.00417.61
8.1.50.0040.00417.64
8.1.40.0030.00617.65
8.1.30.0080.00017.79
8.1.20.0030.00617.66
8.1.10.0040.00417.62
8.1.00.0030.00717.53
8.0.300.0000.00719.95
8.0.290.0000.00816.88
8.0.280.0000.00718.43
8.0.270.0030.00317.38
8.0.260.0000.00817.23
8.0.250.0000.00717.11
8.0.240.0000.00717.14
8.0.230.0030.00317.21
8.0.220.0050.00316.99
8.0.210.0000.00717.05
8.0.200.0030.00317.04
8.0.190.0000.00817.02
8.0.180.0040.00417.07
8.0.170.0030.00516.99
8.0.160.0040.00417.11
8.0.150.0040.00417.11
8.0.140.0070.00016.95
8.0.130.0000.00513.48
8.0.120.0000.00717.11
8.0.110.0020.00516.96
8.0.100.0000.00717.11
8.0.90.0000.00816.91
8.0.80.0120.00917.02
8.0.70.0040.00416.92
8.0.60.0050.00316.97
8.0.50.0000.00716.89
8.0.30.0110.00817.06
8.0.20.0100.01017.40
8.0.10.0040.00416.96
8.0.00.0070.01016.76
7.4.330.0020.00315.08
7.4.320.0000.00616.67
7.4.300.0000.00716.49
7.4.290.0070.00016.61
7.4.280.0050.00316.64
7.4.270.0050.00216.60
7.4.260.0070.00316.55
7.4.250.0000.00716.51
7.4.240.0050.00216.53
7.4.230.0000.00716.71
7.4.220.0030.02316.50
7.4.210.0040.01116.70
7.4.200.0070.00016.58
7.4.160.0040.01216.48
7.4.150.0070.01117.40
7.4.140.0080.01217.86
7.4.130.0080.01016.64
7.4.120.0090.01116.57
7.4.110.0100.00716.59
7.4.100.0090.01216.52
7.4.90.0110.01116.45
7.4.80.0110.00619.39
7.4.70.0150.00616.62
7.4.60.0110.00616.59
7.4.50.0090.00016.67
7.4.40.0140.00316.56
7.4.30.0060.00916.35
7.4.00.0060.00814.86
7.3.330.0020.00213.06
7.3.320.0030.00513.07
7.3.310.0000.00716.18
7.3.300.0000.00716.33
7.3.290.0090.00916.32
7.3.280.0080.01016.34
7.3.270.0070.01117.40
7.3.260.0060.01016.47
7.3.250.0060.01116.47
7.3.240.0070.01416.18
7.3.230.0110.00516.45
7.3.210.0130.01016.16
7.3.200.0080.01419.39
7.3.190.0150.00616.49
7.3.180.0110.00416.29
7.3.170.0030.01316.51
7.3.160.0060.01016.45
7.3.120.0080.00814.83
7.3.110.0100.00714.80
7.3.100.0060.00614.96
7.3.90.0060.00915.23
7.3.80.0080.00815.07
7.3.70.0070.00715.04
7.3.60.0000.01514.79
7.3.50.0080.00814.95
7.3.40.0030.00914.79
7.3.30.0000.01214.93
7.3.20.0030.00616.80
7.3.10.0080.00816.63
7.3.00.0060.00316.71
7.2.330.0090.01416.53
7.2.320.0080.00816.87
7.2.310.0100.00716.64
7.2.300.0030.01916.59
7.2.290.0140.00716.51
7.2.250.0070.00715.12
7.2.240.0060.01315.41
7.2.230.0070.00715.04
7.2.220.0090.00615.30
7.2.210.0060.00914.88
7.2.200.0060.00915.13
7.2.190.0060.00915.06
7.2.180.0110.00315.11
7.2.170.0000.01215.25
7.1.330.0030.00915.45
7.1.320.0040.01115.45
7.1.310.0000.01315.93
7.1.300.0100.00315.95
7.1.290.0030.01015.95
7.1.280.0070.00415.73
7.1.270.0130.00315.66
7.1.260.0070.00715.89
7.1.100.0030.01018.23
7.1.70.0060.00317.32
7.1.60.0140.01119.70
7.1.50.0160.01634.87
7.1.00.0000.08022.41
7.0.200.0040.00417.02
7.0.140.0070.07021.97
7.0.60.0070.06719.86
7.0.50.0030.08317.82
7.0.40.0070.05320.19
7.0.30.0400.06320.06
7.0.20.0170.04020.17
7.0.10.0000.07720.13
7.0.00.0070.08320.12
5.6.280.0000.07721.02
5.6.210.0030.07320.50
5.6.200.0070.04318.23
5.6.190.0030.05020.60
5.6.180.3530.05020.41
5.6.170.0130.05320.38
5.6.160.0170.07320.33
5.6.150.0070.03718.18
5.6.140.0000.06018.21
5.6.130.0070.08018.19
5.6.120.0030.08721.01
5.6.110.0100.08020.95
5.6.100.0100.06721.00
5.6.90.0130.06720.97
5.6.80.0170.07020.46
5.6.70.4630.03720.36
5.5.350.0300.07720.32
5.5.340.0030.04018.02
5.5.330.0100.07020.36
5.5.320.3070.04020.51
5.5.310.0200.08320.32
5.5.300.0030.04317.90
5.5.290.0130.04017.91
5.5.280.0000.09320.96
5.5.270.0070.08720.95
5.5.260.0030.08320.93
5.5.250.0100.07720.50
5.5.240.0270.07020.07
5.4.450.0500.04329.93
5.4.440.0230.05029.93
5.4.430.0300.04029.48
5.4.420.0170.04728.29
5.4.410.0500.05328.29
5.4.400.0330.03328.29
5.4.390.0430.04028.29
5.4.380.0330.05718.50
5.4.370.0370.04318.61
5.4.360.0500.05018.68
5.4.350.0370.05318.71
5.4.340.0370.05018.60
5.4.320.0050.03812.46
5.4.310.0090.03712.45
5.4.300.0100.04112.46
5.4.290.0060.03912.45
5.4.280.0060.03712.35
5.4.270.0090.03412.35
5.4.260.0090.04812.35
5.4.250.0130.03612.35
5.4.240.0100.03612.35
5.4.230.0050.04012.34
5.4.220.0040.03912.34
5.4.210.0080.03312.34
5.4.200.0080.03712.34
5.4.190.0080.03412.34
5.4.180.0080.03412.34
5.4.170.0060.03812.35
5.4.160.0070.03612.35
5.4.150.0050.04312.34
5.4.140.0070.03612.02
5.4.130.0070.03612.01
5.4.120.0140.02811.97
5.4.110.0070.03511.96
5.4.100.0100.03111.96
5.4.90.0120.03211.97
5.4.80.0090.03511.96
5.4.70.0050.03711.96
5.4.60.0050.03611.96
5.4.50.0100.03411.96
5.4.40.0060.03411.95
5.4.30.0090.03511.95
5.4.20.0060.03611.95
5.4.10.0050.03911.95
5.4.00.0030.04011.44
5.3.290.0060.03812.80
5.3.280.0060.04012.70
5.3.270.0030.04312.72
5.3.260.0090.04012.72
5.3.250.0040.04212.72
5.3.240.0080.03612.71
5.3.230.0080.03612.70
5.3.220.0060.03912.68
5.3.210.0080.03712.68
5.3.200.0040.04012.68
5.3.190.0080.03912.68
5.3.180.0060.03712.68
5.3.170.0080.03412.67
5.3.160.0060.03612.67
5.3.150.0060.04112.68
5.3.140.0100.03312.66
5.3.130.0060.03912.66
5.3.120.0070.03712.66
5.3.110.0080.03612.66
5.3.100.0060.03712.12
5.3.90.0080.03612.09
5.3.80.0060.03612.08
5.3.70.0060.03712.07
5.3.60.0050.03812.06
5.3.50.0030.04412.00
5.3.40.0080.04212.00
5.3.30.0100.03811.95
5.3.20.0100.03811.73
5.3.10.0040.04211.69
5.3.00.0060.04311.69
5.2.170.0040.0409.18
5.2.160.0050.0349.19
5.2.150.0100.0289.19
5.2.140.0050.0339.19
5.2.130.0060.0349.15
5.2.120.0050.0299.15
5.2.110.0050.0299.15
5.2.100.0090.0259.15
5.2.90.0070.0289.15
5.2.80.0040.0319.14
5.2.70.0060.0299.15
5.2.60.0080.0299.10
5.2.50.0040.0339.06
5.2.40.0060.0309.04
5.2.30.0060.0329.02
5.2.20.0090.0299.00
5.2.10.0070.0308.93
5.2.00.0090.0338.79
5.1.60.0080.0238.07
5.1.50.0070.0248.06
5.1.40.0060.0298.05
5.1.30.0080.0328.39
5.1.20.0070.0338.41
5.1.10.0060.0318.14
5.1.00.0070.0298.14
5.0.50.0060.0226.64
5.0.40.0050.0256.50
5.0.30.0040.0346.30
5.0.20.0060.0206.28
5.0.10.0050.0226.26
5.0.00.0040.0386.25
4.4.90.0030.0234.78
4.4.80.0030.0224.76
4.4.70.0040.0204.75
4.4.60.0030.0164.75
4.4.50.0030.0164.77
4.4.40.0020.0274.71
4.4.30.0050.0144.75
4.4.20.0060.0184.85
4.4.10.0040.0174.85
4.4.00.0020.0334.75
4.3.110.0030.0194.67
4.3.100.0010.0204.66
4.3.90.0030.0214.63
4.3.80.0050.0304.59
4.3.70.0030.0194.63
4.3.60.0030.0174.63
4.3.50.0060.0164.63
4.3.40.0020.0264.54
4.3.30.0010.0183.30
4.3.20.0000.0183.27
4.3.10.0050.0173.23
4.3.00.0070.01728.29

preferences:
54.18 ms | 401 KiB | 5 Q