3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $datetime = new DateTime('first day of -1 month'); echo $datetime->format('jS, F Y'); echo $datetime->getTimestamp();
Output for 5.6.28, 7.0.12 - 7.1.0
1st, May 20131367392063
Output for 7.0.6
1st, April 20161459473448
Output for 7.0.5
1st, March 20161456846295
Output for 7.0.4
1st, February 20161454288967
Output for 7.0.3
1st, February 20161454289690
Output for 7.0.2
1st, February 20161454327679
Output for 7.0.1
1st, February 20161454328485
Output for 7.0.0
1st, February 20161454337144
Output for 5.6.21
1st, April 20161459542018
Output for 5.6.20
1st, March 20161456829080
Output for 5.6.19
1st, February 20161454283723
Output for 5.6.18
1st, February 20161454327228
Output for 5.6.17
1st, February 20161454305810
Output for 5.6.16
1st, February 20161454343459
Output for 5.6.15
1st, February 20161454346624
Output for 5.6.14
1st, March 20161456861590
Output for 5.6.13
1st, March 20161456789414
Output for 5.6.12
1st, March 20161456836450
Output for 5.6.11
1st, March 20161456862661
Output for 5.6.10
1st, March 20161456868558
Output for 5.6.9
1st, March 20161456800848
Output for 5.6.8
1st, March 20161456828619
Output for 5.6.7
1st, April 20161459544032
Output for 5.5.35
1st, April 20161459467889
Output for 5.5.34
1st, March 20161456850504
Output for 5.5.33
1st, February 20161454328069
Output for 5.5.32
1st, February 20161454348640
Output for 5.5.31
1st, February 20161454316134
Output for 5.5.30
1st, February 20161454353919
Output for 5.5.29
1st, March 20161456839844
Output for 5.5.28
1st, March 20161456848313
Output for 5.5.27
1st, March 20161456857207
Output for 5.5.26
1st, March 20161456791081
Output for 5.5.25
1st, March 20161456812722
Output for 5.5.24
1st, March 20161456839465
Output for 5.4.45
1st, January 20161451678551
Output for 5.4.44
1st, January 20161451678552
Output for 5.4.41 - 5.4.43
1st, January 20161451678553
Output for 5.4.39 - 5.4.40
1st, January 20161451678554
Output for 5.4.37 - 5.4.38
1st, January 20161451678555
Output for 5.4.35 - 5.4.36
1st, January 20161451678556
Output for 5.4.32 - 5.4.34
1st, January 20161451678557
Output for 5.3.29, 5.4.29 - 5.4.31
1st, January 20161451678558
Output for 5.4.26 - 5.4.28
1st, January 20161451678559
Output for 5.4.23 - 5.4.25
1st, January 20161451678560
Output for 5.3.28, 5.4.20 - 5.4.22
1st, January 20161451678561
Output for 5.3.27, 5.4.17 - 5.4.19
1st, January 20161451678562
Output for 5.3.23 - 5.3.26, 5.4.13 - 5.4.16
1st, January 20161451678563
Output for 5.3.20 - 5.3.22, 5.4.9 - 5.4.12
1st, January 20161451678564
Output for 5.3.17 - 5.3.19, 5.4.6 - 5.4.8
1st, January 20161451678565
Output for 5.3.13 - 5.3.16, 5.4.3 - 5.4.5
1st, January 20161451678566
Output for 5.3.9 - 5.3.12, 5.4.0 - 5.4.2
1st, January 20161451678567
Output for 5.3.4 - 5.3.8
1st, January 20161451678568
Output for 5.3.1 - 5.3.3
1st, January 20161451678569
Output for 5.3.0
1st, January 20161451678570
Output for 5.2.0 - 5.2.17
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (first day of -1 month) at position 10 (o): The timezone could not be found in the database' in /in/vjtIl:2 Stack trace: #0 /in/vjtIl(2): DateTime->__construct('first day of -1...') #1 {main} thrown in /in/vjtIl on line 2
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/vjtIl on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/vjtIl on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/vjtIl on line 2