3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL); $currentTime = new \Datetime(); echo "<pre>"; var_dump($currentTime); echo "</pre>"; ?>
Output for 7.3.1
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.000113" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 7.3.0
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.000107" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 7.2.8, 7.2.13
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.000089" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 7.2.12
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.000086" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 7.2.11
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.000087" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 7.2.10
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.000105" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 7.2.9
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.000142" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 7.2.7
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.000115" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 7.2.6
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.000149" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 7.2.5
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.000125" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 7.2.4
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.000118" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 7.2.3
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.000080" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 7.2.2
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.000081" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 7.2.1
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.000079" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 7.2.0
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.000102" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 7.1.25
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.000104" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 7.1.20
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.002973" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 7.1.10
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.038098" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 7.1.7
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.002865" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 7.1.6
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.012216" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 7.1.5
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.007638" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 7.1.0
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.003980" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 5.4.30 - 5.4.45, 5.5.14 - 7.0.20
<pre>object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 14:29:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 5.3.0 - 5.4.29, 5.5.0 - 5.5.13
<pre>object(DateTime)#1 (3) { ["date"]=> string(19) "2016-04-14 14:29:00" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } </pre>
Output for 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/b52ve on line 3 <pre>object(DateTime)#1 (0) { } </pre>
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/b52ve on line 3 Fatal error: Class 'Datetime' not found in /in/b52ve 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/b52ve on line 3 Fatal error: Cannot instantiate non-existent class: datetime in /in/b52ve 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/b52ve on line 3 Fatal error: Cannot instantiate non-existent class: datetime in /in/b52ve on line 3