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(); $diff = $birth->diff($today); echo $diff->format('%y'); // will output 45 $birth = new DateTime('1966-01-23'); $today = new DateTime(); $diff = $birth->diff($today); echo $diff->format('%y'); // will output 45 wrongly $birth = new DateTime('1966-01-24'); // three days difference! $today = new DateTime(); $diff = $birth->diff($today); echo $diff->format('%y'); // 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.0120.00616.75
8.3.50.0090.00922.00
8.3.40.0000.01418.96
8.3.30.0040.01119.04
8.3.20.0030.00620.22
8.3.10.0040.00423.61
8.3.00.0050.00320.82
8.2.180.0080.00816.88
8.2.170.0140.00022.96
8.2.160.0040.01120.50
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00020.93
8.2.110.0040.00422.01
8.2.100.0000.01117.91
8.2.90.0040.00419.18
8.2.80.0030.00517.97
8.2.70.0040.00717.75
8.2.60.0050.00518.04
8.2.50.0060.00618.07
8.2.40.0000.00820.07
8.2.30.0000.01118.43
8.2.20.0050.00317.81
8.2.10.0000.00818.05
8.2.00.0000.00717.80
8.1.280.0130.00625.92
8.1.270.0060.00323.88
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0090.00023.79
8.1.230.0040.00719.00
8.1.220.0070.00017.77
8.1.210.0040.00418.77
8.1.200.0030.00617.34
8.1.190.0080.00017.25
8.1.180.0040.00418.10
8.1.170.0030.00518.63
8.1.160.0080.00021.96
8.1.150.0050.00218.71
8.1.140.0040.00417.62
8.1.130.0030.00317.82
8.1.120.0000.00717.57
8.1.110.0000.00717.64
8.1.100.0000.00717.51
8.1.90.0070.00017.52
8.1.80.0040.00417.60
8.1.70.0000.00717.44
8.1.60.0030.00617.62
8.1.50.0060.00317.53
8.1.40.0000.00717.59
8.1.30.0000.00817.74
8.1.20.0060.00317.65
8.1.10.0000.00817.68
8.1.00.0040.00417.52
8.0.300.0050.00318.77
8.0.290.0070.00016.75
8.0.280.0080.00018.51
8.0.270.0000.00717.32
8.0.260.0030.00317.33
8.0.250.0070.00017.05
8.0.240.0000.00717.04
8.0.230.0050.00216.96
8.0.220.0000.00716.89
8.0.210.0040.00417.03
8.0.200.0030.00317.10
8.0.190.0030.00316.98
8.0.180.0050.00317.01
8.0.170.0000.00817.04
8.0.160.0040.00316.91
8.0.150.0070.00416.93
8.0.140.0040.00416.94
8.0.130.0030.00313.46
8.0.120.0000.00716.94
8.0.110.0040.00417.02
8.0.100.0000.00716.86
8.0.90.0000.00716.92
8.0.80.0030.01616.95
8.0.70.0050.00316.99
8.0.60.0040.00416.92
8.0.50.0000.00816.88
8.0.30.0110.00817.36
8.0.20.0110.00917.40
8.0.10.0030.00617.07
8.0.00.0080.01016.99
7.4.330.0000.00515.01
7.4.320.0060.00016.66
7.4.300.0030.00316.57
7.4.290.0000.00716.64
7.4.280.0040.00416.67
7.4.270.0000.00716.56
7.4.260.0100.00016.66
7.4.250.0040.00416.64
7.4.240.0000.00716.68
7.4.230.0040.00416.64
7.4.220.0130.00616.58
7.4.210.0070.00716.74
7.4.200.0030.00316.78
7.4.160.0030.01416.55
7.4.150.0090.01017.40
7.4.140.0070.01017.86
7.4.130.0070.01116.74
7.4.120.0120.00516.60
7.4.110.0120.00916.58
7.4.100.0100.01016.72
7.4.90.0110.00816.57
7.4.80.0090.00919.39
7.4.70.0120.00916.80
7.4.60.0100.00716.77
7.4.50.0000.00916.46
7.4.40.0070.01416.33
7.4.30.0070.01016.55
7.4.10.0030.01015.11
7.4.00.0090.00815.00
7.3.330.0050.00013.14
7.3.320.0070.00013.06
7.3.310.0040.00416.08
7.3.300.0030.00316.25
7.3.290.0070.00716.19
7.3.280.0120.00616.25
7.3.270.0160.00317.40
7.3.260.0100.00716.53
7.3.250.0170.00316.39
7.3.240.0160.00316.50
7.3.230.0070.01016.39
7.3.210.0070.01416.61
7.3.200.0090.00919.39
7.3.190.0080.01416.65
7.3.180.0030.01216.56
7.3.170.0100.00716.45
7.3.160.0090.00616.54
7.3.130.0100.00715.04
7.3.120.0080.01114.77
7.3.110.0070.01014.91
7.3.100.0130.00314.64
7.3.90.0060.00614.65
7.3.80.0060.00914.98
7.3.70.0040.00414.94
7.3.60.0040.01114.72
7.3.50.0000.01314.95
7.3.40.0060.00314.71
7.3.30.0030.01014.80
7.3.20.0130.00016.65
7.3.10.0080.00516.61
7.3.00.0080.00816.54
7.2.330.0130.00316.77
7.2.320.0090.00916.65
7.2.310.0070.01516.49
7.2.300.0110.00616.72
7.2.290.0100.00716.46
7.2.260.0100.01015.20
7.2.250.0100.00715.05
7.2.240.0040.01114.97
7.2.230.0140.00414.94
7.2.220.0100.01015.04
7.2.210.0040.01515.34
7.2.200.0030.00614.95
7.2.190.0110.00415.21
7.2.180.0130.00615.29
7.2.170.0040.00815.23
7.2.160.0060.00915.28
7.2.150.0040.00716.89
7.2.140.0030.01317.04
7.2.130.0070.00516.90
7.2.120.0050.00816.59
7.2.110.0070.00716.72
7.2.100.0070.01116.80
7.2.90.0070.00716.65
7.2.80.0100.00416.53
7.2.70.0050.01016.98
7.2.60.0070.00816.76
7.2.50.0080.00816.76
7.2.40.0080.00516.87
7.2.30.0070.00617.04
7.2.20.0030.01316.96
7.2.10.0110.00516.86
7.2.00.0110.00616.98
7.1.330.0070.00715.76
7.1.320.0060.00915.64
7.1.310.0000.01215.92
7.1.300.0060.00615.86
7.1.290.0060.01215.81
7.1.280.0040.01115.89
7.1.270.0120.00015.90
7.1.260.0060.01015.61
7.1.250.0080.00615.66
7.1.240.0100.00315.89
7.1.230.0040.00715.84
7.1.220.0040.00915.70
7.1.210.0030.00915.94
7.1.200.0040.00915.91
7.1.190.0070.00215.69
7.1.180.0050.00615.66
7.1.170.0050.01015.93
7.1.160.0070.00515.85
7.1.150.0030.01015.84
7.1.140.0040.00915.99
7.1.130.0080.00615.81
7.1.120.0040.01015.90
7.1.110.0050.00716.03
7.1.100.0060.00616.62
7.1.90.0070.00715.93
7.1.80.0090.00615.72
7.1.70.0110.00116.22
7.1.60.0080.01117.23
7.1.50.0100.01322.15
7.1.40.0070.00815.81
7.1.30.0050.00915.92
7.1.20.0080.00615.90
7.1.10.0040.00915.81
7.1.00.0060.02918.00
7.0.330.0080.00415.70
7.0.320.0100.00615.45
7.0.310.0070.00415.33
7.0.300.0060.00715.52
7.0.290.0040.00715.61
7.0.280.0020.01115.48
7.0.270.0060.00815.54
7.0.260.0030.00915.65
7.0.250.0090.00515.47
7.0.240.0040.01115.70
7.0.230.0070.00715.54
7.0.220.0030.00915.39
7.0.210.0030.00815.49
7.0.200.0040.00715.94
7.0.190.0060.00915.38
7.0.180.0090.00615.56
7.0.170.0070.00515.48
7.0.160.0050.00715.59
7.0.150.0000.01315.57
7.0.140.0030.02917.67
7.0.130.0040.00615.40
7.0.120.0000.01315.41
7.0.110.0070.00815.61
7.0.100.0030.00915.40
7.0.90.0030.01015.65
7.0.80.0040.00815.53
7.0.70.0050.00815.51
7.0.60.0120.02217.02
7.0.50.0100.02616.38
7.0.40.0030.02315.81
7.0.30.0120.01915.74
7.0.20.0070.02015.75
7.0.10.0060.03315.79
7.0.00.0040.03615.71
5.6.400.0070.00714.21
5.6.390.0000.01414.16
5.6.380.0100.00514.42
5.6.370.0000.01514.57
5.6.360.0090.00614.38
5.6.350.0050.00814.53
5.6.340.0080.00614.53
5.6.330.0040.00814.44
5.6.320.0080.01014.41
5.6.310.0050.00814.50
5.6.300.0090.00414.67
5.6.290.0030.00914.29
5.6.280.0060.02916.67
5.6.270.0060.00614.72
5.6.260.0030.01014.46
5.6.250.0090.00314.52
5.6.240.0050.00814.58
5.6.230.0080.00514.57
5.6.220.0080.00714.54
5.6.210.0030.02216.65
5.6.200.0030.03515.71
5.6.190.0080.02016.42
5.6.180.1130.01516.50
5.6.170.0090.03816.40
5.6.160.0030.03816.43
5.6.150.0010.02415.70
5.6.140.0080.02915.71
5.6.130.0070.02815.73
5.6.120.0060.01816.71
5.6.110.0080.03316.70
5.6.100.0070.02316.72
5.6.90.0100.02416.51
5.6.80.0100.03216.40
5.6.70.1230.01716.49
5.6.60.0020.01314.32
5.6.50.0090.00414.26
5.6.40.0070.00514.39
5.6.30.0020.01314.31
5.6.20.0080.00514.32
5.6.10.0100.00314.50
5.6.00.0070.00714.22
5.5.380.0040.00712.85
5.5.370.0070.00412.74
5.5.360.0090.00512.58
5.5.350.0120.03015.34
5.5.340.0080.02014.44
5.5.330.0030.02715.29
5.5.320.1080.01915.29
5.5.310.0150.01815.29
5.5.300.0030.02914.55
5.5.290.0060.02214.43
5.5.280.0070.03215.40
5.5.270.0080.02015.56
5.5.260.0040.02815.44
5.5.250.0080.02815.37
5.5.240.0110.01615.25
5.5.230.0020.00812.54
5.5.220.0040.01012.84
5.5.210.0040.01112.63
5.5.200.0070.00512.60
5.5.190.0030.01012.74
5.5.180.0090.00412.77
5.5.170.0030.00914.07
5.5.160.0050.00612.81
5.5.150.0040.00812.79
5.5.140.0080.00612.65
5.5.130.0080.00312.62
5.5.120.0050.00812.81
5.5.110.0000.00812.63
5.5.100.0100.00312.84
5.5.90.0070.00512.62
5.5.80.0030.00912.83
5.5.70.0100.00212.84
5.5.60.0030.00812.86
5.5.50.0050.00812.70
5.5.40.0030.00812.92
5.5.30.0060.00612.56
5.5.20.0020.00712.76
5.5.10.0030.00912.70
5.5.00.0020.00912.68
5.4.450.0070.02117.69
5.4.440.0160.01517.67
5.4.430.0110.01517.52
5.4.420.0110.01817.33
5.4.410.0060.02117.03
5.4.400.0180.01417.03
5.4.390.0200.01917.12
5.4.380.0160.02013.73
5.4.370.0180.01713.88
5.4.360.0140.02113.90
5.4.350.0310.02113.89
5.4.340.0130.02313.86
5.4.330.0060.00311.59
5.4.320.0020.01811.74
5.4.310.0040.01611.79
5.4.300.0050.01611.76
5.4.290.0020.02111.81
5.4.280.0060.01511.75
5.4.270.0060.01811.85
5.4.260.0060.01911.74
5.4.250.0040.02111.71
5.4.240.0060.01611.87
5.4.230.0060.01711.66
5.4.220.0070.01611.78
5.4.210.0020.02011.85
5.4.200.0050.01711.75
5.4.190.0040.01711.70
5.4.180.0050.01611.79
5.4.170.0060.01911.80
5.4.160.0030.01711.79
5.4.150.0040.01511.77
5.4.140.0020.01911.64
5.4.130.0040.01811.70
5.4.120.0030.01611.71
5.4.110.0050.01611.69
5.4.100.0050.01811.68
5.4.90.0060.01611.68
5.4.80.0080.01411.59
5.4.70.0070.01311.68
5.4.60.0060.01811.69
5.4.50.0040.01611.67
5.4.40.0050.01511.60
5.4.30.0030.01711.67
5.4.20.0040.02011.71
5.4.10.0050.01811.59
5.4.00.0060.01411.52
5.3.290.0040.01811.90
5.3.280.0040.01711.81
5.3.270.0050.01511.81
5.3.260.0040.01811.82
5.3.250.0030.01811.79
5.3.240.0050.01711.77
5.3.230.0030.01911.76
5.3.220.0050.01411.72
5.3.210.0030.01911.72
5.3.200.0050.01811.71
5.3.190.0070.02011.73
5.3.180.0050.01511.78
5.3.170.0060.02511.73
5.3.160.0040.01811.81
5.3.150.0080.01511.73
5.3.140.0050.01511.75
5.3.130.0060.01911.69
5.3.120.0040.02411.66
5.3.110.0030.01811.69
5.3.100.0060.01411.59
5.3.90.0030.01711.53
5.3.80.0060.01611.48
5.3.70.0050.01511.46
5.3.60.0060.01811.55
5.3.50.0030.02011.50
5.3.40.0040.01911.44
5.3.30.0030.01611.50
5.3.20.0050.01511.37
5.3.10.0040.01911.36
5.3.00.0070.01911.27
5.2.170.0050.0249.47
5.2.160.0060.0209.49
5.2.150.0050.0219.45
5.2.140.0040.0189.31
5.2.130.0050.0159.35
5.2.120.0010.0229.34
5.2.110.0040.0189.32
5.2.100.0010.0209.20
5.2.90.0040.0169.37
5.2.80.0080.0189.25
5.2.70.0070.0219.32
5.2.60.0070.0149.26
5.2.50.0070.0189.13
5.2.40.0030.0169.22
5.2.30.0070.0149.22
5.2.20.0020.0189.21
5.2.10.0050.0169.11
5.2.00.0040.0189.04
5.1.60.0040.0138.23
5.1.50.0020.0208.26
5.1.40.0050.0198.27
5.1.30.0070.0178.54
5.1.20.0070.0178.38
5.1.10.0050.0208.33
5.1.00.0050.0188.24
5.0.50.0070.0147.39
5.0.40.0020.0177.32
5.0.30.0060.0227.23
5.0.20.0060.0157.21
5.0.10.0050.0147.20
5.0.00.0020.0227.20
4.4.90.0040.0076.46
4.4.80.0020.0096.45
4.4.70.0020.0106.46
4.4.60.0050.0086.45
4.4.50.0020.0106.46
4.4.40.0010.0156.43
4.4.30.0030.0096.45
4.4.20.0030.0106.50
4.4.10.0030.0106.50
4.4.00.0020.0186.46
4.3.110.0020.0136.41
4.3.100.0030.0096.41
4.3.90.0030.0126.39
4.3.80.0020.0186.37
4.3.70.0020.0116.39
4.3.60.0040.0126.39
4.3.50.0030.0126.39
4.3.40.0020.0166.34
4.3.30.0040.0085.72
4.3.20.0010.0105.71
4.3.10.0020.0135.69
4.3.00.0080.01318.22

preferences:
50.19 ms | 401 KiB | 5 Q