3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = (object) new DateTime('now'); echo '<pre>'; print_r($date);
based on HuOkc
Output for 7.3.0rc3
<pre>DateTime Object ( [date] => 2016-03-24 11:24:30.002823 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.3.0beta1
<pre>DateTime Object ( [date] => 2016-03-24 11:24:30.002497 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.3.0alpha1
<pre>DateTime Object ( [date] => 2016-03-24 11:24:30.002982 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.2.6
<pre>DateTime Object ( [date] => 2016-03-24 11:24:30.004144 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.2.0
<pre>DateTime Object ( [date] => 2016-03-24 11:24:30.003825 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.1.20
<pre>DateTime Object ( [date] => 2016-03-24 11:24:30.002505 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.1.10
<pre>DateTime Object ( [date] => 2016-03-24 11:24:30.004822 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.1.7
<pre>DateTime Object ( [date] => 2016-03-24 11:24:30.002871 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.1.6
<pre>DateTime Object ( [date] => 2016-03-24 11:24:30.012354 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.1.5
<pre>DateTime Object ( [date] => 2016-03-24 11:24:30.011385 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.1.0
<pre>DateTime Object ( [date] => 2016-03-24 11:24:30.003944 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.28, 7.0.20
<pre>DateTime Object ( [date] => 2016-03-24 11:24:30.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.6
<pre>DateTime Object ( [date] => 2016-05-21 17:58:55.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 7.0.5
<pre>DateTime Object ( [date] => 2016-04-14 15:17:51.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.33, 5.6.18 - 5.6.19, 7.0.4
<pre>DateTime Object ( [date] => 2016-03-24 11:24:31.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.31 - 5.5.32, 5.6.17, 7.0.1 - 7.0.3
<pre>DateTime Object ( [date] => 2016-03-24 11:24:32.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.30, 5.6.13 - 5.6.16, 7.0.0
<pre>DateTime Object ( [date] => 2016-03-24 11:24:33.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.21
<pre>DateTime Object ( [date] => 2016-05-02 20:17:31.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.6.20
<pre>DateTime Object ( [date] => 2016-04-10 12:19:04.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.28 - 5.5.29, 5.6.11 - 5.6.12
<pre>DateTime Object ( [date] => 2016-03-24 11:24:34.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.24 - 5.5.27, 5.6.8 - 5.6.10
<pre>DateTime Object ( [date] => 2016-03-24 11:24:35.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.20 - 5.5.23, 5.6.4 - 5.6.7
<pre>DateTime Object ( [date] => 2016-03-24 11:24:36.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.14 - 5.5.19, 5.6.0 - 5.6.3
<pre>DateTime Object ( [date] => 2016-03-24 11:24:37.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.35
<pre>DateTime Object ( [date] => 2016-05-23 08:55:04.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.34
<pre>DateTime Object ( [date] => 2016-04-11 14:33:55.000000 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.13
<pre>DateTime Object ( [date] => 2016-03-24 11:24:37 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.2 - 5.5.12
<pre>DateTime Object ( [date] => 2016-03-24 11:24:38 [timezone_type] => 3 [timezone] => Europe/Amsterdam )
Output for 5.5.0 - 5.5.1
<pre>DateTime Object ( [date] => 2016-03-24 11:24:39 [timezone_type] => 3 [timezone] => Europe/Amsterdam )