3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php date_default_timezone_set('Australia/Perth'); $d=new DateTime(); $d = var_export($d, true); var_dump(json_encode($d));
Output for 7.2.6
string(142) ""DateTime::__set_state(array(\n 'date' => '2014-06-20 10:35:21.002983',\n 'timezone_type' => 3,\n 'timezone' => 'Australia\/Perth',\n))""
Output for 7.2.0
string(142) ""DateTime::__set_state(array(\n 'date' => '2014-06-20 10:35:21.003177',\n 'timezone_type' => 3,\n 'timezone' => 'Australia\/Perth',\n))""
Output for 7.1.20
string(142) ""DateTime::__set_state(array(\n 'date' => '2014-06-20 10:35:21.002028',\n 'timezone_type' => 3,\n 'timezone' => 'Australia\/Perth',\n))""
Output for 7.1.10
string(142) ""DateTime::__set_state(array(\n 'date' => '2014-06-20 10:35:21.003240',\n 'timezone_type' => 3,\n 'timezone' => 'Australia\/Perth',\n))""
Output for 7.1.7
string(142) ""DateTime::__set_state(array(\n 'date' => '2014-06-20 10:35:21.002646',\n 'timezone_type' => 3,\n 'timezone' => 'Australia\/Perth',\n))""
Output for 7.1.6
string(142) ""DateTime::__set_state(array(\n 'date' => '2014-06-20 10:35:21.011935',\n 'timezone_type' => 3,\n 'timezone' => 'Australia\/Perth',\n))""
Output for 7.1.5
string(142) ""DateTime::__set_state(array(\n 'date' => '2014-06-20 10:35:21.012620',\n 'timezone_type' => 3,\n 'timezone' => 'Australia\/Perth',\n))""
Output for 7.1.0
string(142) ""DateTime::__set_state(array(\n 'date' => '2014-06-20 10:35:21.004033',\n 'timezone_type' => 3,\n 'timezone' => 'Australia\/Perth',\n))""
Output for 5.4.30 - 5.4.45, 5.5.14 - 7.0.20
string(142) ""DateTime::__set_state(array(\n 'date' => '2014-06-20 10:35:21.000000',\n 'timezone_type' => 3,\n 'timezone' => 'Australia\/Perth',\n))""
Output for 5.3.0 - 5.4.29, 5.5.0 - 5.5.13
string(135) ""DateTime::__set_state(array(\n 'date' => '2014-06-20 10:35:21',\n 'timezone_type' => 3,\n 'timezone' => 'Australia\/Perth',\n))""
Output for 5.2.0 - 5.2.17
string(34) ""DateTime::__set_state(array(\n))""
Output for 5.1.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/4PpsM on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function date_default_timezone_set() in /in/4PpsM on line 3
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_default_timezone_set() in /in/4PpsM on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: date_default_timezone_set() in /in/4PpsM on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_default_timezone_set() in /in/4PpsM on line 3