3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = new \DateTime(); echo $date->format('Y-M-d'); echo "\n"; $date2 = new \DateTime('2014-05-05 08:07:05'); echo $date2->format('Y-M-d'); echo "\n"; if($date >= $date2){ echo "a"; } else { echo "b"; }
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.26, 5.6.28, 7.0.14 - 7.1.0
2014-Mar-28 2014-May-05 b
Output for 7.0.6
2016-May-03 2014-May-05 a
Output for 7.0.5
2016-Apr-02 2014-May-05 a
Output for 7.0.4
2016-Mar-09 2014-May-05 a
Output for 7.0.3
2016-Mar-17 2014-May-05 a
Output for 7.0.2
2016-Mar-21 2014-May-05 a
Output for 7.0.1
2016-Mar-23 2014-May-05 a
Output for 7.0.0
2016-Mar-26 2014-May-05 a
Output for hhvm-3.12.0
2016-Mar-11 2014-May-05 a
Output for hhvm-3.10.0
2016-Mar-29 2014-May-05 a
Output for 5.6.21
2016-May-01 2014-May-05 a
Output for 5.6.20
2016-Apr-09 2014-May-05 a
Output for 5.6.19
2016-Mar-06 2014-May-05 a
Output for 5.6.18
2016-Mar-14 2014-May-05 a
Output for 5.6.17
2016-Mar-19 2014-May-05 a
Output for 5.6.16
2016-Mar-27 2014-May-05 a
Output for 5.6.15
2016-Mar-28 2014-May-05 a
Output for 5.6.14
2016-Apr-01 2014-May-05 a
Output for 5.6.13
2016-Apr-14 2014-May-05 a
Output for 5.6.12
2016-Apr-19 2014-May-05 a
Output for 5.6.11
2016-Apr-22 2014-May-05 a
Output for 5.6.10
2016-Apr-24 2014-May-05 a
Output for 5.6.9
2016-Apr-27 2014-May-05 a
Output for 5.6.8
2016-Apr-29 2014-May-05 a
Output for 5.6.7
2016-May-24 2014-May-05 a
Output for 5.5.35
2016-May-21 2014-May-05 a
Output for 5.5.34
2016-Apr-10 2014-May-05 a
Output for 5.5.33
2016-Mar-08 2014-May-05 a
Output for 5.5.32
2016-Mar-15 2014-May-05 a
Output for 5.5.31
2016-Mar-20 2014-May-05 a
Output for 5.5.30
2016-Mar-31 2014-May-05 a
Output for 5.5.29
2016-Apr-16 2014-May-05 a
Output for 5.5.28
2016-Apr-20 2014-May-05 a
Output for 5.5.27
2016-Apr-21 2014-May-05 a
Output for 5.5.26
2016-Apr-25 2014-May-05 a
Output for 5.5.25
2016-Apr-28 2014-May-05 a
Output for 5.5.24
2016-Apr-30 2014-May-05 a
Output for 5.4.44 - 5.4.45
2015-Sep-11 2014-May-05 a
Output for 5.4.42 - 5.4.43
2015-Jul-18 2014-May-05 a
Output for 5.4.41
2015-May-26 2014-May-05 a
Output for 5.4.39 - 5.4.40
2015-May-15 2014-May-05 a
Output for 5.4.38
2015-Mar-02 2014-May-05 a
Output for 5.4.34 - 5.4.37
2015-Feb-08 2014-May-05 a
Output for 5.3.29, 5.4.27 - 5.4.32
2014-Sep-08 2014-May-05 a
Output for 5.2.2 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/9rb3a on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/9rb3a on line 5 2014-Mar-28 2014-May-05 b
Output for 5.2.0 - 5.2.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/9rb3a on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/9rb3a on line 5 2014-Mar-28 2014-May-05 a
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/9rb3a on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/9rb3a on line 5 Fatal error: Class 'DateTime' not found in /in/9rb3a on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/9rb3a on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/9rb3a on line 5 Fatal error: Cannot instantiate non-existent class: datetime in /in/9rb3a on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/9rb3a on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/9rb3a on line 5 Fatal error: Cannot instantiate non-existent class: datetime in /in/9rb3a on line 2