3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @param \DateTime $date Date of the original meeting * @return \DateTime Date of the next meeting */ function getSameDayLastYear(\DateTime $date = null) { if(!$date){ $date = new \DateTime(); } return (new \DateTime())->setISODate((int)$date->format('o') - 1, (int)$date->format('W'), (int)$date->format('N')); } $start = new \DateTime(); $end = new \DateTime('+4 years'); $interval = new \DateInterval('P1D'); $period = new \DatePeriod($start, $interval, $end); $format = 'Y-m-d'; echo "insert ignore into TblDatesDev (date, lastYear) VALUES \n"; foreach($period as $date){ echo "('".$date->format($format)."','".getSameDayLastYear($date)->format($format)."'),\n"; //echo $date->format($format) . ' => ' . getSameDayLastYear($date)->format($format) . "\n"; }

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.0130.01916.63
8.3.50.0030.02218.07
8.3.40.0100.01318.79
8.3.30.0060.02118.72
8.3.20.0030.00921.60
8.3.10.0060.00823.64
8.3.00.0040.01118.12
8.2.180.0130.02316.74
8.2.170.0170.01022.96
8.2.160.0070.02819.41
8.2.150.0030.01024.18
8.2.140.0040.00824.66
8.2.130.0040.00826.16
8.2.120.0120.00021.18
8.2.110.0030.01019.48
8.1.280.0140.01825.92
8.1.270.0000.01222.14
8.1.260.0090.00326.35
8.1.250.0090.00328.09
8.1.240.0110.00419.26
7.4.10.0060.02615.30
7.4.00.0050.02415.00
7.3.130.0100.02915.02
7.3.120.0000.03214.99
7.3.110.0070.02415.28
7.3.100.0100.01715.25
7.3.90.0160.01015.04
7.3.80.0030.02615.27
7.3.70.0060.01815.11
7.3.60.0110.00815.04
7.3.50.0000.03514.77
7.3.40.0030.02615.11
7.3.30.0000.02114.95
7.3.20.0070.02317.06
7.3.10.0070.02016.84
7.3.00.0060.01916.73
7.2.260.0070.02615.31
7.2.250.0100.02115.25
7.2.240.0030.02314.87
7.2.230.0070.02415.44
7.2.220.0030.02415.46
7.2.210.0110.01415.05
7.2.200.0040.01415.00
7.2.190.0100.01415.16
7.2.180.0030.01915.25
7.2.170.0000.02315.11
7.2.160.0000.02315.16
7.2.150.0030.01917.24
7.2.140.0070.02016.86
7.2.130.0000.01916.96
7.2.120.0030.02517.23
7.2.110.0060.01917.22
7.2.100.0100.01317.22
7.2.90.0030.01617.29
7.2.80.0000.01717.22
7.2.70.0100.01616.81
7.2.60.0150.00916.99
7.2.50.0160.01317.22
7.2.40.0140.02017.33
7.2.30.0040.02117.03
7.2.20.0040.02517.20
7.2.10.0100.02017.21
7.2.00.0060.01817.24
7.1.330.0130.01315.72
7.1.320.0040.02516.00
7.1.310.0100.01316.03
7.1.300.0070.02116.13
7.1.290.0070.01815.89
7.1.280.0130.01015.71
7.1.270.0030.02615.95
7.1.260.0040.01415.99
7.1.250.0070.01515.96
7.1.240.0130.01315.96
7.1.230.0120.01215.88
7.1.220.0100.01315.73
7.1.210.0030.02016.04
7.1.200.0030.01616.14
7.1.190.0070.01615.85
7.1.180.0030.02116.05
7.1.170.0160.01915.76
7.1.160.0040.01515.77
7.1.150.0100.01615.78
7.1.140.0100.02015.79
7.1.130.0000.02916.13
7.1.120.0120.01216.05
7.1.110.0070.01615.95
7.1.100.0070.02315.65
7.1.90.0100.01616.14
7.1.80.0070.01716.08
7.1.70.0030.01716.72
7.1.60.0600.02724.83
7.1.50.0780.02524.45
7.1.40.0150.02424.50
7.1.30.0170.01924.51
7.1.20.0720.02824.61
7.1.10.0680.02515.55
7.1.00.0780.01515.33
7.0.330.0000.02615.62
7.0.320.0070.01715.43
7.0.310.0000.02715.36
7.0.300.0130.01615.75
7.0.290.0070.01315.60
7.0.280.0150.01215.30
7.0.270.0030.02315.55
7.0.260.0030.02115.55
7.0.250.0030.02615.71
7.0.240.0030.02415.63
7.0.230.0090.01515.38
7.0.220.0040.01515.64
7.0.210.0070.01415.68
7.0.200.0110.02015.40
7.0.190.0680.02315.29
7.0.180.0100.02215.11
7.0.170.0050.03015.01
7.0.160.0830.02015.09
7.0.150.1000.01815.16
7.0.140.0770.02015.21
7.0.130.0680.02015.20
7.0.120.0620.02215.24
7.0.110.0580.01815.22
7.0.100.0600.01814.92
7.0.90.0640.01915.10
7.0.80.0540.02215.15
7.0.70.0550.02315.05
7.0.60.0490.02515.18
7.0.50.0470.01815.16
7.0.40.0880.01714.26
7.0.30.0520.02114.33
7.0.20.0870.02314.16
7.0.10.0480.02414.20
7.0.00.0520.01814.22
5.6.400.0110.01814.46
5.6.390.0030.02214.48
5.6.380.0000.02414.79
5.6.370.0000.03314.53
5.6.360.0130.01614.55
5.6.350.0110.01414.60
5.6.340.0150.01514.66
5.6.330.0030.02714.24
5.6.320.0100.02014.53
5.6.310.0090.01914.53
5.6.300.0130.01614.79
5.6.290.0110.01414.61
5.6.280.0040.01814.64
5.6.270.0100.02214.54
5.6.260.0040.01814.54
5.6.250.0100.01414.59
5.6.240.0190.00914.41
5.6.230.0100.01314.31
5.6.220.0070.02014.75
5.6.210.0030.02214.40
5.6.200.0090.01914.58
5.6.190.0130.01914.65
5.6.180.0070.02414.57
5.6.170.0030.02614.58
5.6.160.0070.01714.22
5.6.150.0030.02514.69
5.6.140.0100.01314.50
5.6.130.0000.02714.67
5.6.120.0090.01314.50
5.6.110.0100.01914.56
5.6.100.0000.02714.52
5.6.90.0030.02714.50
5.6.80.0070.02114.37
5.6.70.0140.02514.34
5.6.60.0070.02714.44
5.6.50.0100.01714.35
5.6.40.0060.02314.32
5.6.30.0130.01914.61
5.6.20.0060.02514.29
5.6.10.0070.01414.17
5.6.00.0070.01714.45

preferences:
43.38 ms | 401 KiB | 5 Q