3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo "<hr /><pre>Date Now = "; echo date('Y-m-d H:i:s'); echo "</pre>"; //die; $date = new DateTime('now'); echo "<hr /><pre>Date Now Obj = "; print_r($date); echo "</pre>"; //die;
Output for 7.1.0
<hr /><pre>Date Now = 2014-05-15 08:47:15</pre><hr /><pre>Date Now Obj = DateTime Object ( [date] => 2014-05-15 08:47:15.006026 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) </pre>
Output for 5.4.30 - 5.4.45, 5.5.14 - 7.0.14
<hr /><pre>Date Now = 2014-05-15 08:47:15</pre><hr /><pre>Date Now Obj = DateTime Object ( [date] => 2014-05-15 08:47:15.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) </pre>
Output for 5.3.0 - 5.4.29, 5.5.0 - 5.5.13
<hr /><pre>Date Now = 2014-05-15 08:47:15</pre><hr /><pre>Date Now Obj = DateTime Object ( [date] => 2014-05-15 08:47:15 [timezone_type] => 3 [timezone] => Europe/Amsterdam ) </pre>
Output for 5.2.0 - 5.2.17
<hr /><pre>Date Now = 2014-05-15 08:47:15</pre><hr /><pre>Date Now Obj = DateTime Object ( ) </pre>
Output for 5.0.0 - 5.0.5, 5.1.1 - 5.1.6
<hr /><pre>Date Now = 2014-05-15 08:47:15</pre> Fatal error: Class 'DateTime' not found in /in/epsjY on line 3
Process exited with code 255.
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/epsjY on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.9
<hr /><pre>Date Now = 2014-05-15 08:47:15</pre> Fatal error: Cannot instantiate non-existent class: datetime in /in/epsjY on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<hr /><pre>Date Now = 2014-05-15 08:47:15</pre> Fatal error: Cannot instantiate non-existent class: datetime in /in/epsjY on line 3