3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dateStr = '2013-08-21 20:26:12'; $date = new \DateTime($dateStr); echo $date->format('dS M') . "\n"; echo $date->format('dS F, Y') . "\n"; echo $date->format('h:i A - dS F, Y') . "\n";
Output for 5.3.0 - 7.1.0
21st Aug 21st August, 2013 08:26 PM - 21st August, 2013
Output for 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/M7qEO on line 3 21st Aug 21st August, 2013 08:26 PM - 21st August, 2013
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/M7qEO on line 3 Fatal error: Class 'DateTime' not found in /in/M7qEO on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/M7qEO on line 3 Fatal error: Cannot instantiate non-existent class: datetime in /in/M7qEO on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/M7qEO on line 3 Fatal error: Cannot instantiate non-existent class: datetime in /in/M7qEO on line 3