3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date_object = new DateTime('2011-04-24'); echo "Today: ".date('Y-m-d').PHP_EOL. "Yesterday: ".date('Y-m-d', mktime(0, 0, 0, date("m"), date("d")-1, date("Y"))).PHP_EOL. "42 days ago: ".date('Y-m-d', mktime(0, 0, 0, date("m"), date("d")-42, date("Y"))).PHP_EOL. "OP's date: ".date('Y-m-d', mktime(0, 0, 0, $date_object->format("m"), $date_object->format("d")-1, $date_object->format("Y") ) );

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.4.10.0040.00419.79
8.3.140.0060.00316.62
8.3.130.0040.00418.61
8.3.120.0080.00020.69
8.3.110.0040.00416.54
8.3.100.0090.00916.81
8.3.90.0070.00026.77
8.3.80.0060.00316.63
8.3.70.0130.00916.88
8.3.60.0100.00718.56
8.3.50.0110.00516.56
8.3.40.0070.00718.95
8.3.30.0000.01518.85
8.3.20.0040.00420.39
8.3.10.0050.00321.90
8.3.00.0030.00718.03
8.2.260.0090.00618.33
8.2.250.0050.00318.81
8.2.240.0060.00317.09
8.2.230.0060.00320.94
8.2.220.0060.01137.54
8.2.210.0080.00026.77
8.2.200.0050.00516.88
8.2.190.0120.00616.58
8.2.180.0150.00025.92
8.2.170.0110.00319.25
8.2.160.0130.00722.09
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00926.16
8.2.120.0070.00021.06
8.2.110.0110.01122.24
8.2.100.0060.00617.97
8.2.90.0000.00818.09
8.2.80.0060.00319.13
8.2.70.0050.00317.88
8.2.60.0040.00417.88
8.2.50.0000.00817.75
8.2.40.0030.00620.59
8.2.30.0000.00821.05
8.2.20.0000.00818.18
8.2.10.0070.00018.14
8.2.00.0040.00418.05
8.1.310.0070.01120.18
8.1.300.0060.00320.39
8.1.290.0090.00030.84
8.1.280.0070.01125.92
8.1.270.0040.00424.66
8.1.260.0080.00026.35
8.1.250.0100.00328.09
8.1.240.0060.00323.98
8.1.230.0110.00020.97
8.1.220.0040.00417.79
8.1.210.0000.00818.77
8.1.200.0090.00017.60
8.1.190.0080.00017.47
8.1.180.0040.00418.10
8.1.170.0050.00318.84
8.1.160.0000.00719.10
8.1.150.0040.00418.89
8.1.140.0050.00319.77
8.1.130.0000.00717.57
8.1.120.0020.00818.27
8.1.110.0070.00617.59
8.1.100.0080.00517.67
8.1.90.0070.00717.66
8.1.80.0050.00817.66
8.1.70.0090.00417.70
8.1.60.0100.00517.74
8.1.50.0060.00917.61
8.1.40.0100.00517.69
8.1.30.0090.00617.80
8.1.20.0100.00417.74
8.1.10.0100.00417.67
8.1.00.0090.00617.70
8.0.300.0080.00019.98
8.0.290.0060.00316.88
8.0.280.0040.00418.54
8.0.270.0050.00317.09
8.0.260.0000.00617.02
8.0.250.0070.00517.10
8.0.240.0100.00317.14
8.0.230.0100.00317.17
8.0.220.0050.00617.07
8.0.210.0090.00417.07
8.0.200.0080.00517.10
8.0.190.0090.00417.11
8.0.180.0100.00317.13
8.0.170.0060.00817.16
8.0.160.0050.00617.15
8.0.150.0070.00517.06
8.0.140.0090.00417.08
8.0.130.0110.00316.48
8.0.120.0090.00517.11
8.0.110.0090.00417.08
8.0.100.0090.00417.09
8.0.90.0100.00317.12
8.0.80.0060.00917.13
8.0.70.0080.00417.07
8.0.60.0070.00617.05
8.0.50.0070.00617.10
8.0.30.0070.00717.13
8.0.20.0090.00617.26
8.0.10.0080.00417.20
8.0.00.0090.00517.18
7.4.330.0070.00214.71
7.4.320.0090.00216.64
7.4.300.0060.00616.63
7.4.290.0070.00716.55
7.4.280.0090.00316.56
7.4.270.0090.00416.56
7.4.260.0080.00316.14
7.4.250.0100.00416.65
7.4.240.0070.00616.60
7.4.230.0060.00516.56
7.4.220.0090.00416.53
7.4.210.0090.00516.56
7.4.200.0080.00416.48
7.4.190.0070.00516.56
7.4.180.0060.00616.62
7.4.160.0090.00516.58
7.4.150.0110.00216.67
7.4.140.0090.00616.89
7.4.130.0100.00416.36
7.4.120.0090.00616.61
7.4.110.0090.00516.50
7.4.100.0080.00816.44
7.4.90.0080.00716.56
7.4.80.0070.00716.90
7.4.70.0080.00616.40
7.4.60.0100.00516.48
7.4.50.0090.00516.42
7.4.40.0090.00516.40
7.4.30.0090.00516.41
7.4.20.0070.00616.40
7.4.10.0070.00716.27
7.4.00.0070.00716.08
7.3.330.0090.00315.77
7.3.320.0110.00515.85
7.3.310.0080.00716.25
7.3.300.0100.00416.29
7.3.290.0110.00416.24
7.3.280.0090.00616.32
7.3.270.0100.00616.37
7.3.260.0120.00316.40
7.3.250.0100.00616.43
7.3.240.0070.00816.39
7.3.230.0090.00616.34
7.3.220.0110.00316.34
7.3.210.0100.00616.37
7.3.200.0080.00816.40
7.3.190.0100.00616.33
7.3.180.0110.00416.36
7.3.170.0110.00516.35
7.3.160.0090.00716.43
7.3.150.0120.00316.27
7.3.140.0100.00516.27
7.3.130.0120.00416.14
7.3.120.0100.00515.92
7.3.110.0100.00615.91
7.3.100.0090.00615.95
7.3.90.0100.00516.10
7.3.80.0110.00415.88
7.3.70.0090.00615.91
7.3.60.0070.00815.97
7.3.50.0090.00615.93
7.3.40.0100.00615.93
7.3.30.0090.00615.91
7.3.20.0160.00516.95
7.3.10.0130.00616.94
7.3.00.0140.00516.90
7.2.340.0110.00416.61
7.2.330.0130.00416.62
7.2.320.0100.00616.67
7.2.310.0110.00516.70
7.2.300.0110.00616.62
7.2.290.0070.01016.69
7.2.280.0110.00416.67
7.2.270.0120.00416.62
7.2.260.0100.00616.56
7.2.250.0100.00416.29
7.2.240.0070.00916.29
7.2.230.0100.00616.28
7.2.220.0100.00516.32
7.2.210.0090.00716.13
7.2.200.0080.00716.20
7.2.190.0100.00516.21
7.2.180.0130.00316.14
7.2.170.0090.00616.26
7.2.160.0100.00516.35
7.2.150.0130.00817.34
7.2.140.0150.00617.39
7.2.130.0180.00517.45
7.2.120.0150.00717.46
7.2.110.0150.00717.34
7.2.100.0150.00517.50
7.2.90.0140.00717.51
7.2.80.0160.00417.52
7.2.70.0140.00617.53
7.2.60.0130.00617.49
7.2.50.0140.00517.46
7.2.40.0180.00317.57
7.2.30.0130.00817.52
7.2.20.0160.00617.52
7.2.10.0110.01017.56
7.2.00.0130.00617.71
7.1.330.0100.00616.83
7.1.320.0090.00616.81
7.1.310.0130.00516.56
7.1.300.0130.00516.55
7.1.290.0120.00616.60
7.1.280.0100.00616.54
7.1.270.0110.00616.54
7.1.260.0120.00616.45
7.1.250.0120.00716.32
7.1.240.0200.00516.31
7.1.230.0190.00516.34
7.1.220.0160.00716.27
7.1.210.0160.00616.41
7.1.200.0160.00616.29
7.1.190.0180.00516.29
7.1.180.0160.00816.33
7.1.170.0170.00416.33
7.1.160.0170.00716.30
7.1.150.0150.00716.31
7.1.140.0180.00616.31
7.1.130.0180.00516.32
7.1.120.0180.00616.30
7.1.110.0150.00816.33
7.1.100.0150.00616.42
7.1.90.0180.00516.29
7.1.80.0180.00516.39
7.1.70.0160.00716.38
7.1.60.0170.00818.06
7.1.50.0190.00818.03
7.1.40.0160.00818.02
7.1.30.0200.00517.99
7.1.20.0160.00717.99
7.1.10.0170.00516.36
7.1.00.0150.00716.36
7.0.330.0180.00616.05
7.0.320.0280.00416.03
7.0.310.0140.00816.09
7.0.300.0160.00616.03
7.0.290.0190.00516.10
7.0.280.0160.00716.06
7.0.270.0170.00616.09
7.0.260.0230.00616.01
7.0.250.0160.00616.23
7.0.240.0190.00616.09
7.0.230.0160.00616.15
7.0.220.0160.00616.10
7.0.210.0160.00616.12
7.0.200.0140.00616.21
7.0.190.0150.00516.12
7.0.180.0150.00716.13
7.0.170.0140.00816.22
7.0.160.0160.00716.05
7.0.150.0140.00716.11
7.0.140.0130.00516.08
7.0.130.0110.00616.19
7.0.120.0140.00716.12
7.0.110.0140.00616.14
7.0.100.0160.00516.10
7.0.90.0160.00516.08
7.0.80.0430.00616.11
7.0.70.0220.00616.09
7.0.60.0170.00716.08
7.0.50.0170.00516.08
7.0.40.0160.00516.19
7.0.30.0140.00716.23
7.0.20.0140.00616.17
7.0.10.0160.00516.20
7.0.00.0140.00716.13
5.6.400.0090.00815.71
5.6.390.0120.00515.77
5.6.380.0130.00815.66
5.6.370.0110.00515.93
5.6.360.0090.00715.93
5.6.350.0100.00616.02
5.6.340.0080.00815.96
5.6.330.0100.00615.95
5.6.320.0100.00715.97
5.6.310.0100.00715.87
5.6.300.0100.00515.81
5.6.290.0110.00416.01
5.6.280.0090.00715.87
5.6.270.0100.00615.87
5.6.260.0130.00715.88
5.6.250.0120.00415.90
5.6.240.0120.00515.95
5.6.230.0120.00415.99
5.6.220.0110.00616.01
5.6.210.0100.00716.05
5.6.200.0110.00516.15
5.6.190.0120.00416.10
5.6.180.0110.00616.04
5.6.170.0120.00416.08
5.6.160.0090.00616.03
5.6.150.0090.00716.11
5.6.140.0120.00316.05
5.6.130.0100.00515.98
5.6.120.0120.00516.05
5.6.110.0110.00616.06
5.6.100.0120.00415.98
5.6.90.0130.00415.86
5.6.80.0120.00415.88
5.6.70.0120.00316.02
5.6.60.0090.00716.02
5.6.50.0100.00615.89
5.6.40.0110.00615.89
5.6.30.0080.00815.87
5.6.20.0120.00415.88
5.6.10.0100.00615.84
5.6.00.0120.00415.92

preferences:
61.57 ms | 403 KiB | 5 Q