3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sdate = "1981-11-04"; $edate = "2013-09-04"; $date_diff = abs(strtotime($edate) - strtotime($sdate)); print "$date_diff"; $years = floor($date_diff / (365*60*60*24)); $months = floor(($date_diff - $years * 365*60*60*24) / (30*60*60*24)); $days = floor(($date_diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24)); printf("%d years, %d months, %d days", $years, $months, $days); ?> - See more at: http://www.w3resource.com/php-exercises/php-date-exercises.php#sthash.xJA52BEw.dpuf

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.0140.00718.43
8.3.50.0110.01022.14
8.3.40.0040.01118.93
8.3.30.0100.00718.92
8.3.20.0030.00620.33
8.3.10.0080.00020.61
8.3.00.0000.00819.78
8.2.180.0150.00616.38
8.2.170.0140.00022.96
8.2.160.0100.00719.32
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0070.00022.23
8.2.110.0070.00320.41
8.2.100.0100.00018.03
8.2.90.0040.00419.17
8.2.80.0000.00817.97
8.2.70.0080.00017.75
8.2.60.0000.00818.16
8.2.50.0060.00318.07
8.2.40.0080.00018.33
8.2.30.0000.01019.31
8.2.20.0040.00417.93
8.2.10.0060.00318.34
8.2.00.0040.00417.99
8.1.280.0090.00925.92
8.1.270.0090.00022.14
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0060.00324.01
8.1.230.0070.00419.16
8.1.220.0000.00817.91
8.1.210.0000.00918.77
8.1.200.0070.00717.47
8.1.190.0030.00517.48
8.1.180.0030.00518.10
8.1.170.0040.00418.77
8.1.160.0040.00422.00
8.1.150.0040.00418.96
8.1.140.0040.00417.67
8.1.130.0030.00317.86
8.1.120.0000.00717.71
8.1.110.0040.00417.61
8.1.100.0040.00417.55
8.1.90.0000.00717.63
8.1.80.0000.00717.72
8.1.70.0000.00817.59
8.1.60.0030.00617.65
8.1.50.0060.00317.74
8.1.40.0040.00417.64
8.1.30.0040.00417.80
8.1.20.0080.00017.68
8.1.10.0040.00417.59
8.1.00.0030.00817.71
8.0.300.0000.00718.77
8.0.290.0000.00716.88
8.0.280.0070.00018.65
8.0.270.0000.00717.39
8.0.260.0030.00318.57
8.0.250.0000.00617.25
8.0.240.0030.00317.05
8.0.230.0030.00317.19
8.0.220.0040.00417.10
8.0.210.0000.00817.11
8.0.200.0000.00817.07
8.0.190.0030.00617.05
8.0.180.0040.00417.06
8.0.170.0070.00017.13
8.0.160.0040.00417.04
8.0.150.0000.00716.91
8.0.140.0000.00816.93
8.0.130.0000.00713.39
8.0.120.0000.00717.13
8.0.110.0040.00417.12
8.0.100.0040.00417.07
8.0.90.0000.00716.89
8.0.80.0060.01316.96
8.0.70.0000.00717.05
8.0.60.0080.00017.06
8.0.50.0070.00017.01
8.0.30.0100.00917.33
8.0.20.0120.01117.44
8.0.10.0040.00417.02
8.0.00.0080.01016.96
7.4.330.0000.00515.32
7.4.320.0030.00316.79
7.4.300.0030.00316.69
7.4.290.0040.00416.78
7.4.280.0070.00016.59
7.4.270.0040.00416.72
7.4.260.0040.00416.67
7.4.250.0040.00416.65
7.4.240.0060.00216.85
7.4.230.0030.00316.58
7.4.220.0120.00716.80
7.4.210.0030.01016.80
7.4.200.0030.00616.54
7.4.160.0070.01116.75
7.4.150.0080.01117.40
7.4.140.0110.00617.86
7.4.130.0080.00916.69
7.4.120.0140.00716.90
7.4.110.0100.00716.71
7.4.100.0110.00616.70
7.4.90.0120.00416.92
7.4.80.0070.01016.68
7.4.70.0130.00316.72
7.4.60.0100.01316.98
7.4.50.0040.00016.66
7.4.40.0120.00917.02
7.4.30.0080.01116.59
7.4.00.0140.00015.21
7.3.330.0000.00513.23
7.3.320.0000.00513.27
7.3.310.0040.00416.65
7.3.300.0030.00316.35
7.3.290.0090.00616.52
7.3.280.0070.00816.48
7.3.270.0070.01317.40
7.3.260.0150.00716.80
7.3.250.0090.00916.59
7.3.240.0180.00016.79
7.3.230.0070.01116.68
7.3.210.0030.01316.70
7.3.200.0110.01219.39
7.3.190.0180.00616.41
7.3.180.0060.01216.60
7.3.170.0080.00816.58
7.3.160.0070.00716.39
7.2.330.0090.00816.86
7.2.320.0120.00616.92
7.2.310.0080.00816.87
7.2.300.0090.01316.76
7.2.290.0060.01016.71
7.2.00.0060.00619.18
7.1.200.0070.00716.06
7.1.100.0060.00618.18
7.1.70.0000.00717.16
7.1.60.0030.02019.32
7.1.50.0090.01316.82
7.1.00.0000.08022.31
7.0.200.0000.00816.92
7.0.140.0000.07321.95
7.0.60.0030.06019.89
7.0.50.0000.09017.65
7.0.40.0170.06720.18
7.0.30.0330.04720.34
7.0.20.0170.08319.99
7.0.10.0030.06020.18
7.0.00.0100.05320.13
5.6.280.0030.07321.12
5.6.210.0130.07720.74
5.6.200.0000.04318.10
5.6.190.0100.03720.34
5.6.180.0400.05320.58
5.6.170.0200.08720.48
5.6.160.0070.05720.48
5.6.150.0100.04318.18
5.6.140.0030.05018.18
5.6.130.0030.08718.18
5.6.120.0100.08020.80
5.6.110.0130.08021.11
5.6.100.0070.04321.03
5.6.90.0230.06020.97
5.6.80.0170.06720.38
5.5.350.0100.03720.30
5.5.340.0100.08018.01
5.5.330.0100.05020.20
5.5.320.0470.06720.29
5.5.310.0200.09020.33
5.5.300.0070.03717.91
5.5.290.0230.04317.90
5.5.280.0100.03320.73
5.5.270.0000.04720.72
5.5.260.0000.09020.79
5.5.250.0070.08320.70
5.5.240.0200.06720.37
5.4.450.0030.06319.48
5.4.440.0870.07019.61
5.4.430.0800.05019.58
5.4.420.0770.06019.63
5.4.410.0770.05019.34
5.4.400.0770.06019.11
5.4.390.0700.06019.19
5.4.380.0530.05718.49
5.4.370.0330.06018.68
5.4.360.0530.04318.69
5.4.350.0370.07718.74
5.4.340.0400.04718.50
5.4.320.0050.04312.45
5.4.310.0040.04112.45
5.4.300.0080.03412.45
5.4.290.0090.03412.45
5.4.280.0040.03712.35
5.4.270.0070.03412.35
5.4.260.0040.03912.35
5.4.250.0050.03812.35
5.4.240.0030.03812.35
5.4.230.0030.04012.34
5.4.220.0050.03612.34
5.4.210.0080.03612.34
5.4.200.0080.03512.34
5.4.190.0090.03912.34
5.4.180.0060.03612.34
5.4.170.0080.03412.35
5.4.160.0060.03612.34
5.4.150.0090.03212.34
5.4.140.0060.03812.02
5.4.130.0060.03512.01
5.4.120.0030.03711.97
5.4.110.0060.03411.96
5.4.100.0050.03611.97
5.4.90.0080.03411.97
5.4.80.0020.04011.96
5.4.70.0050.03511.96
5.4.60.0050.03611.96
5.4.50.0050.03511.96
5.4.40.0060.03411.95
5.4.30.0060.03511.95
5.4.20.0100.03011.95
5.4.10.0050.03411.95
5.4.00.0040.03611.44
5.3.290.0090.03412.80
5.3.280.0030.04512.71
5.3.270.0040.04612.73
5.3.260.0050.04012.72
5.3.250.0050.03712.72
5.3.240.0060.03712.72
5.3.230.0040.04612.71
5.3.220.0060.03712.68
5.3.210.0060.03812.68
5.3.200.0090.03312.68
5.3.190.0080.03512.67
5.3.180.0060.03512.68
5.3.170.0080.03412.66
5.3.160.0060.03912.67
5.3.150.0070.03812.67
5.3.140.0070.03512.66
5.3.130.0070.03612.66
5.3.120.0070.03612.66
5.3.110.0040.03912.66
5.3.100.0060.03612.12
5.3.90.0060.03612.09
5.3.80.0060.03512.07
5.3.70.0070.03812.07
5.3.60.0050.03712.06
5.3.50.0060.03612.00
5.3.40.0060.03612.00
5.3.30.0040.03711.95
5.3.20.0040.03711.73
5.3.10.0070.03411.69
5.3.00.0060.03611.68
5.2.170.0050.0309.18
5.2.160.0070.0299.19
5.2.150.0070.0359.19
5.2.140.0030.0349.18
5.2.130.0050.0289.14
5.2.120.0080.0339.14
5.2.110.0070.0299.14
5.2.100.0050.0279.14
5.2.90.0030.0309.14
5.2.80.0030.0319.14
5.2.70.0080.0269.14
5.2.60.0060.0289.09
5.2.50.0040.0319.05
5.2.40.0050.0299.04
5.2.30.0080.0349.01
5.2.20.0030.0309.00
5.2.10.0050.0288.94
5.2.00.0050.0308.79
5.1.60.0040.0308.09
5.1.50.0070.0268.08
5.1.40.0050.0248.06
5.1.30.0060.0258.41
5.1.20.0040.0308.43
5.1.10.0050.0258.15
5.1.00.0060.0288.16
5.0.50.0040.0206.65
5.0.40.0020.0216.51
5.0.30.0070.0306.32
5.0.20.0050.0196.29
5.0.10.0010.0236.27
5.0.00.0040.0316.26
4.4.90.0030.0164.78
4.4.80.0030.0154.75
4.4.70.0050.0144.75
4.4.60.0040.0164.75
4.4.50.0030.0164.77
4.4.40.0030.0274.71
4.4.30.0050.0144.76
4.4.20.0020.0174.85
4.4.10.0030.0174.85
4.4.00.0010.0274.76
4.3.110.0050.0134.66
4.3.100.0020.0154.66
4.3.90.0050.0174.64
4.3.80.0030.0304.58
4.3.70.0020.0154.63
4.3.60.0020.0154.63
4.3.50.0030.0154.63
4.3.40.0020.0254.53
4.3.30.0010.0173.32
4.3.20.0030.0153.29
4.3.10.0010.0173.25
4.3.00.0030.0206.73

preferences:
56.95 ms | 401 KiB | 5 Q