3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $discount = 33; $sale_end = '2014-01-30 00:00:00'; $sale_end = substr($sale_end, 0, 10); echo $sale_end; $date = new DateTime($sale_end); $sale_end = $date->format('F j'); echo sprintf('%d%% OFF Ends %d', $discount, $sale_end);
Output for 5.2.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
2014-01-3033% OFF Ends 0
Output for 5.0.0 - 5.1.6
2014-01-30 Fatal error: Class 'DateTime' not found in /in/mYsLc on line 8
Process exited with code 255.
Output for 4.3.2 - 4.4.9
2014-01-30 Fatal error: Cannot instantiate non-existent class: datetime in /in/mYsLc on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1
2014-01-30 Fatal error: Cannot instantiate non-existent class: datetime in /in/mYsLc on line 8