3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $month = 5; $month = sprintf("%02d", $month); echo $month; echo "\r\n"; $monthStart = new DateTime(); $monthStart->setDate(2013, $month, 01); echo $monthStart->format('jS, F Y'); echo "\r\n"; echo $monthStart->getTimestamp(); echo "\r\n"; $monthEnd = $monthStart->modify('+1 month'); //$monthEnd->setDate(2013, $month, 32); echo $monthEnd->format('jS, F Y'); echo "\r\n"; echo $monthEnd->getTimestamp(); echo "\r\n";
Output for 5.6.28, 7.0.12 - 7.2.8
05 1st, May 2013 1367396758 1st, June 2013 1370075158
Output for 7.0.6
05 1st, May 2013 1367415814 1st, June 2013 1370094214
Output for 7.0.5
05 1st, May 2013 1367400329 1st, June 2013 1370078729
Output for 7.0.4
05 1st, May 2013 1367444242 1st, June 2013 1370122642
Output for 7.0.3
05 1st, May 2013 1367364727 1st, June 2013 1370043127
Output for 7.0.2
05 1st, May 2013 1367385992 1st, June 2013 1370064392
Output for 7.0.1
05 1st, May 2013 1367396762 1st, June 2013 1370075162
Output for 7.0.0
05 1st, May 2013 1367403092 1st, June 2013 1370081492
Output for 5.6.21
05 1st, May 2013 1367425324 1st, June 2013 1370103724
Output for 5.6.20
05 1st, May 2013 1367396945 1st, June 2013 1370075345
Output for 5.6.19
05 1st, May 2013 1367387326 1st, June 2013 1370065726
Output for 5.6.18
05 1st, May 2013 1367420097 1st, June 2013 1370098497
Output for 5.6.17
05 1st, May 2013 1367375590 1st, June 2013 1370053990
Output for 5.6.16
05 1st, May 2013 1367406077 1st, June 2013 1370084477
Output for 5.6.15
05 1st, May 2013 1367408998 1st, June 2013 1370087398
Output for 5.6.14
05 1st, May 2013 1367429620 1st, June 2013 1370108020
Output for 5.6.13
05 1st, May 2013 1367432225 1st, June 2013 1370110625
Output for 5.6.12
05 1st, May 2013 1367399628 1st, June 2013 1370078028
Output for 5.6.11
05 1st, May 2013 1367421202 1st, June 2013 1370099602
Output for 5.6.10
05 1st, May 2013 1367428737 1st, June 2013 1370107137
Output for 5.6.9
05 1st, May 2013 1367362491 1st, June 2013 1370040891
Output for 5.6.8
05 1st, May 2013 1367392230 1st, June 2013 1370070630
Output for 5.5.35
05 1st, May 2013 1367381727 1st, June 2013 1370060127
Output for 5.5.34
05 1st, May 2013 1367404945 1st, June 2013 1370083345
Output for 5.5.33
05 1st, May 2013 1367398622 1st, June 2013 1370077022
Output for 5.5.32
05 1st, May 2013 1367434588 1st, June 2013 1370112988
Output for 5.5.31
05 1st, May 2013 1367387283 1st, June 2013 1370065683
Output for 5.5.30
05 1st, May 2013 1367415605 1st, June 2013 1370094005
Output for 5.5.29
05 1st, May 2013 1367396972 1st, June 2013 1370075372
Output for 5.5.28
05 1st, May 2013 1367410055 1st, June 2013 1370088455
Output for 5.5.27
05 1st, May 2013 1367415672 1st, June 2013 1370094072
Output for 5.5.26
05 1st, May 2013 1367438538 1st, June 2013 1370116938
Output for 5.5.25
05 1st, May 2013 1367379098 1st, June 2013 1370057498
Output for 5.5.24
05 1st, May 2013 1367403493 1st, June 2013 1370081893
Output for 5.4.45
05 1st, May 2013 1367403977 1st, June 2013 1370082377
Output for 5.4.43 - 5.4.44
05 1st, May 2013 1367403978 1st, June 2013 1370082378
Output for 5.4.41 - 5.4.42
05 1st, May 2013 1367403979 1st, June 2013 1370082379
Output for 5.4.39 - 5.4.40
05 1st, May 2013 1367403980 1st, June 2013 1370082380
Output for 5.4.37 - 5.4.38
05 1st, May 2013 1367403981 1st, June 2013 1370082381
Output for 5.4.34 - 5.4.36
05 1st, May 2013 1367403982 1st, June 2013 1370082382
Output for 5.3.29, 5.4.31 - 5.4.32
05 1st, May 2013 1367403983 1st, June 2013 1370082383
Output for 5.4.28 - 5.4.30
05 1st, May 2013 1367403984 1st, June 2013 1370082384
Output for 5.4.25 - 5.4.27
05 1st, May 2013 1367403985 1st, June 2013 1370082385
Output for 5.3.28, 5.4.21 - 5.4.24
05 1st, May 2013 1367403986 1st, June 2013 1370082386
Output for 5.4.18 - 5.4.20
05 1st, May 2013 1367403987 1st, June 2013 1370082387
Output for 5.3.25 - 5.3.27, 5.4.16 - 5.4.17
05 1st, May 2013 1367403988 1st, June 2013 1370082388
Output for 5.3.23 - 5.3.24, 5.4.12 - 5.4.15
05 1st, May 2013 1367403989 1st, June 2013 1370082389
Output for 5.3.18 - 5.3.22, 5.4.9 - 5.4.11
05 1st, May 2013 1367403990 1st, June 2013 1370082390
Output for 5.3.15 - 5.3.17, 5.4.5 - 5.4.8
05 1st, May 2013 1367403991 1st, June 2013 1370082391
Output for 5.3.11 - 5.3.14, 5.4.2 - 5.4.4
05 1st, May 2013 1367403992 1st, June 2013 1370082392
Output for 5.3.6 - 5.3.10, 5.4.0 - 5.4.1
05 1st, May 2013 1367403993 1st, June 2013 1370082393
Output for 5.3.2 - 5.3.5
05 1st, May 2013 1367403994 1st, June 2013 1370082394
Output for 5.3.0 - 5.3.1
05 1st, May 2013 1367403995 1st, June 2013 1370082395
Output for 5.2.0 - 5.2.17
05 1st, May 2013 Fatal error: Call to undefined method DateTime::getTimestamp() in /in/Bkpmq on line 16
Process exited with code 255.
Output for 5.0.0 - 5.1.6
05 Fatal error: Class 'DateTime' not found in /in/Bkpmq on line 11
Process exited with code 255.
Output for 4.3.2 - 4.4.9
05 Fatal error: Cannot instantiate non-existent class: datetime in /in/Bkpmq on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1
05 Fatal error: Cannot instantiate non-existent class: datetime in /in/Bkpmq on line 11