3v4l.org

run code in 300+ PHP versions simultaneously
<?php $now = time(); $date = strtotime('first day of previous month 00:00:00', $now); var_dump($date->format('Y-m-d H:i:s')); // string(19) "2013-11-01 00:00:00" $date = new DateTime('first day of previous month 00:00:00', new DateTimeZone('Europe/Amsterdam')); var_dump($date->format('Y-m-d H:i:s')); // string(19) "2013-11-01 00:00:00" $date = new DateTime('midnight first day of previous month', new DateTimeZone('Europe/Amsterdam')); var_dump($date->format('Y-m-d H:i:s')); // string(19) "2013-11-01 00:00:00" $date = new DateTime('midnight first day of previous month', new DateTimeZone('UTC')); var_dump($date->format('Y-m-d H:i:s')); // string(19) "2013-11-01 00:00:00"

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)
7.3.10.0190.00016.47
7.3.00.0190.00016.50
7.2.130.0100.01016.64
7.2.120.0060.01316.79
7.2.110.0100.01316.38
7.2.100.0070.00717.12
7.2.90.0070.01017.01
7.2.80.0130.01016.85
7.2.70.0110.00417.07
7.2.60.0120.00517.00
7.2.50.0160.01016.80
7.2.40.0120.00617.00
7.2.30.0060.01217.08
7.2.20.0090.00616.85
7.2.10.0120.00616.88
7.2.00.0060.01018.35
7.1.250.0200.00015.90
7.1.240.0100.01015.78
7.1.230.0150.00415.88
7.1.220.0170.00015.88
7.1.210.0090.00615.55
7.1.200.0100.00415.76
7.1.190.0080.00815.92
7.1.180.0090.00916.00
7.1.170.0070.00815.71
7.1.160.0180.00315.70
7.1.150.0070.00715.79
7.1.140.0060.00816.02
7.1.130.0100.01315.80
7.1.120.0060.00616.06
7.1.110.0080.00815.94
7.1.100.0090.00817.07
7.1.90.0080.01216.02
7.1.80.0150.00615.60
7.1.70.0040.00916.44
7.1.60.0100.01217.58
7.1.50.0090.00816.56
7.1.40.0130.00315.75
7.1.30.0080.00815.77
7.1.20.0120.00615.93
7.1.10.0130.00316.01
7.1.00.0050.04219.17
7.0.330.0140.00715.26
7.0.320.0120.00815.32
7.0.310.0070.01115.44
7.0.300.0130.00715.16
7.0.290.0110.01115.63
7.0.280.0070.01115.15
7.0.270.0110.00715.25
7.0.260.0130.00615.40
7.0.250.0030.01014.96
7.0.240.0160.00315.35
7.0.230.0120.00315.49
7.0.220.0120.00915.67
7.0.210.0100.01015.23
7.0.200.0050.00716.08
7.0.190.0090.00915.46
7.0.180.0150.00315.39
7.0.170.0060.01315.20
7.0.160.0100.00715.43
7.0.150.0170.00315.63
7.0.140.0140.00515.35
7.0.130.0080.00815.37
7.0.120.0110.00715.62
7.0.110.0200.00015.24
7.0.100.0130.01015.10
7.0.90.0160.00015.25
7.0.80.0290.02917.70
7.0.70.0150.04217.64
7.0.60.0210.04317.68
7.0.50.0220.04717.92
7.0.40.0050.03516.80
7.0.30.0060.04216.84
7.0.20.0090.04316.60
7.0.10.0100.04016.80
7.0.00.0050.04316.62
5.6.380.0070.00714.27
5.6.370.0060.01014.27
5.6.360.0030.00814.11
5.6.350.0080.00014.55
5.6.340.0060.00614.29
5.6.330.0090.00914.39
5.6.320.0060.00914.33
5.6.310.0080.00514.36
5.6.300.0070.00714.18
5.6.290.0030.01014.26
5.6.280.0070.02217.69
5.6.270.0030.01414.37
5.6.260.0080.00314.14
5.6.250.0070.00614.34
5.6.240.0040.01114.39
5.6.230.0080.02217.50
5.6.220.0070.03017.50
5.6.210.0090.03917.48
5.6.200.0080.03117.54
5.6.190.0100.04217.58
5.6.180.0130.04717.66
5.6.170.0040.03217.77
5.6.160.0030.03517.81
5.6.150.0080.04317.79
5.6.140.0040.03217.70
5.6.130.0080.04017.66
5.6.120.0100.03817.66
5.6.110.0080.03517.65
5.6.100.0020.02717.61
5.6.90.0100.04317.51
5.6.80.0020.03417.40
5.6.70.0050.02717.25
5.6.60.0050.03417.22
5.6.50.0080.04117.27
5.6.40.0100.03617.18
5.6.30.0050.02617.13
5.6.20.0110.04117.37
5.6.10.0080.03717.32
5.6.00.0050.04517.28
5.5.380.0030.00610.82
5.5.370.0110.02315.63
5.5.360.0080.03515.72
5.5.350.0080.03315.58
5.5.340.0070.04116.02
5.5.330.0090.03015.90
5.5.320.0050.03516.14
5.5.310.0120.03515.86
5.5.300.0070.04315.81
5.5.290.0080.04016.03
5.5.280.0060.03315.78
5.5.270.0030.04415.98
5.5.260.0050.04315.78
5.5.250.0070.03015.83
5.5.240.0070.04315.57
5.5.230.0060.04115.47
5.5.220.0020.05015.61
5.5.210.0050.03815.66
5.5.200.0070.04015.40
5.5.190.0050.04415.53
5.5.180.0060.02315.45
5.5.170.0060.00610.96
5.5.160.0050.04615.61
5.5.150.0060.02715.52
5.5.140.0050.03715.63
5.5.130.0030.02515.71
5.5.120.0040.03115.55
5.5.110.0100.02015.58
5.5.100.0070.02115.43
5.5.90.0050.03615.50
5.5.80.0080.02515.52
5.5.70.0080.02815.38
5.5.60.0080.02515.40
5.5.50.0060.02615.55
5.5.40.0060.02115.59
5.5.30.0070.03515.57
5.5.20.0100.01515.63
5.5.10.0080.04215.33
5.5.00.0000.02615.37
5.4.450.0070.02615.13
5.4.440.0060.02015.15
5.4.430.0100.03615.15
5.4.420.0090.03915.28
5.4.410.0080.01815.08
5.4.400.0030.04114.95
5.4.390.0070.03315.06
5.4.380.0000.04514.90
5.4.370.0050.03914.88
5.4.360.0110.03714.86
5.4.350.0100.02314.90
5.4.340.0070.04015.09
5.4.330.0120.00010.71
5.4.320.0060.03214.98
5.4.310.0050.04514.96
5.4.300.0100.03515.08
5.4.290.0070.02015.13
5.4.280.0090.02114.88
5.4.270.0090.03814.97
5.4.260.0060.02314.94
5.4.250.0080.02314.89
5.4.240.0060.02414.88
5.4.230.0020.02714.98
5.4.220.0030.02515.04
5.4.210.0020.04314.94
5.4.200.0030.02715.05
5.4.190.0020.03215.01
5.4.180.0040.02114.90
5.4.170.0050.02715.06
5.4.160.0080.03715.04
5.4.150.0050.01914.95
5.4.140.0050.04013.71
5.4.130.0020.03313.56
5.4.120.0030.02013.54
5.4.110.0050.02913.61
5.4.100.0020.02313.56
5.4.90.0030.02513.62
5.4.80.0100.03213.55
5.4.70.0020.02313.58
5.4.60.0070.01913.47
5.4.50.0000.02713.47
5.4.40.0020.02613.74
5.4.30.0080.01513.57
5.4.20.0110.02513.56
5.4.10.0060.03313.69
5.4.00.0070.02813.34

preferences:
41.66 ms | 401 KiB | 5 Q