3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime( '2016-08-25' ); echo $date->format('Y-m-d'),"\n"; $day = $date->format('j'); $date->modify('first day of sixth month'); $date->modify('+' . (min($day, $date->format('t')) - 1) . ' days'); echo $date->format('Y-m-d');

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.1.70.0030.00317.74
8.1.60.0040.00417.81
8.1.50.0030.00617.67
8.1.40.0030.00517.73
8.1.30.0040.00417.80
8.1.20.0030.00617.76
8.1.10.0000.00717.80
8.1.00.0060.00317.65
8.0.200.0000.00817.23
8.0.190.0040.00417.29
8.0.180.0000.00717.22
8.0.170.0030.00617.29
8.0.160.0040.00417.23
8.0.150.0000.00717.13
8.0.140.0070.00017.07
8.0.130.0000.00513.63
8.0.120.0070.00017.13
8.0.110.0040.00417.25
8.0.100.0040.00417.23
8.0.90.0050.00317.10
8.0.80.0040.01117.20
8.0.70.0070.00017.04
8.0.60.0000.00717.02
8.0.50.0000.00716.99
8.0.30.0060.01217.29
8.0.20.0090.01017.44
8.0.10.0040.00417.24
8.0.00.0100.00716.97
7.4.300.0030.00316.50
7.4.290.0030.00316.58
7.4.280.0040.00416.61
7.4.270.0030.00316.63
7.4.260.0050.00316.65
7.4.250.0030.00516.59
7.4.240.0040.00416.65
7.4.230.0000.00816.71
7.4.220.0140.00416.71
7.4.210.0160.00316.71
7.4.200.0050.00216.80
7.4.160.0050.01116.64
7.4.150.0120.00917.40
7.4.140.0110.00717.86
7.4.130.0070.01216.66
7.4.120.0150.00216.71
7.4.110.0000.01716.62
7.4.100.0100.01316.71
7.4.90.0130.00916.68
7.4.80.0100.00719.39
7.4.70.0120.01016.69
7.4.60.0090.00616.73
7.4.50.0140.00416.57
7.4.40.0100.00716.72
7.4.30.0000.02116.80
7.4.00.0030.01215.22
7.3.330.0000.00513.30
7.3.320.0060.00013.14
7.3.310.0050.00216.43
7.3.300.0080.00016.31
7.3.290.0070.00716.40
7.3.280.0080.00916.40
7.3.270.0060.01517.40
7.3.260.0110.00616.69
7.3.250.0110.00816.47
7.3.240.0120.00716.54
7.3.230.0050.01116.68
7.3.210.0030.01316.66
7.3.200.0100.00716.70
7.3.190.0060.00916.41
7.3.180.0140.00616.55
7.3.170.0070.01016.67
7.3.160.0120.00616.47
7.2.330.0070.01016.89
7.2.320.0100.01016.73
7.2.310.0090.00916.91
7.2.300.0110.01416.78
7.2.290.0120.00917.00
7.2.60.0030.00817.22
7.2.00.0030.01319.77
7.1.200.0060.00316.03
7.1.70.0030.00717.34
7.1.60.0040.00717.17
7.1.00.0030.07722.36
7.0.200.0060.00314.94
7.0.100.0070.05719.91
7.0.90.0100.05720.04
7.0.80.0100.05720.05
7.0.70.0100.05720.05
7.0.60.0200.04320.00
7.0.50.0100.06020.36
7.0.40.0200.04720.21
7.0.30.0170.05020.31
7.0.20.0170.05020.34
7.0.10.0130.05320.30
7.0.00.0170.05020.23
5.6.250.0070.05720.74
5.6.240.0070.06020.75
5.6.230.0070.05720.66
5.6.220.0100.05320.47
5.6.210.0130.05020.56
5.6.200.0170.05321.20
5.6.190.0070.06721.12
5.6.180.0030.06021.11
5.6.170.0070.05721.08
5.6.160.0000.06321.13
5.6.150.0130.05321.06
5.6.140.0100.05321.07
5.6.130.0030.06021.05
5.6.120.0130.05721.07
5.6.110.0100.06021.00
5.6.100.0170.05021.00
5.6.90.0170.05021.04
5.6.80.0130.05320.46
5.6.70.0030.06020.43
5.6.60.0030.06320.38
5.6.50.0100.05320.39
5.6.40.0000.06320.52
5.6.30.0130.05020.46
5.6.20.0100.05320.52
5.6.10.0270.05020.45
5.6.00.0100.08020.41

preferences:
12.47 ms | 406 KiB | 5 Q