3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php date_default_timezone_set ("UTC"); $date = DateTime::createFromFormat('U.u', microtime(true)); print_r($date); $current_time = $time->format('Y-m-d H:i:s'); echo $current_time; ?>
based on N9S1J
Output for 7.0.5 - 7.0.21, 7.0.23 - 7.0.32, 7.1.1, 7.1.3 - 7.1.8, 7.1.10 - 7.2.12
DateTime Object ( [date] => 2017-07-06 09:43:37.000100 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Uncaught Error: Call to a member function format() on null in /in/HQZ2v:6 Stack trace: #0 {main} thrown in /in/HQZ2v on line 6
Process exited with code 255.
Output for 7.0.22, 7.1.0, 7.1.2, 7.1.9
DateTime Object ( [date] => 2017-07-06 09:43:37.000200 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Uncaught Error: Call to a member function format() on null in /in/HQZ2v:6 Stack trace: #0 {main} thrown in /in/HQZ2v on line 6
Process exited with code 255.
Output for 7.0.0 - 7.0.4
DateTime Object ( [date] => 2017-07-06 09:43:37.000100 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Uncaught Error: Call to a member function format() on unknown in /in/HQZ2v:6 Stack trace: #0 {main} thrown in /in/HQZ2v on line 6
Process exited with code 255.
Output for hhvm-3.22.0
DateTime Object ( [date] => 2017-07-06 09:43:37.151100 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line -1 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function format() on a non-object (null)' in /in/HQZ2v:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.21.3
DateTime Object ( [date] => 2017-07-06 09:43:37.135700 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function format() on a non-object (null)' in /in/HQZ2v:6 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.21.0
DateTime Object ( [date] => 2017-07-06 09:43:37.137200 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function format() on a non-object (null)' in /in/HQZ2v:6 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.20.2
DateTime Object ( [date] => 2018-12-01 00:38:25.186800 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function format() on a non-object (null)' in /in/HQZ2v:6 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.19.2
DateTime Object ( [date] => 2018-12-01 00:38:25.322500 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function format() on a non-object (null)' in /in/HQZ2v:6 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.18.5
DateTime Object ( [date] => 2017-07-06 09:43:37.128200 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function format() on a non-object (null)' in /in/HQZ2v:6 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.18.4
DateTime Object ( [date] => 2017-07-06 09:43:37.130700 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function format() on a non-object (null)' in /in/HQZ2v:6 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.15.4
DateTime Object ( [date] => 2017-07-06 09:43:37.115900 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function format() on a non-object (null)' in /in/HQZ2v:6 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.38
DateTime Object ( [date] => 2017-07-06 09:43:37.000100 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Call to a member function format() on null in /in/HQZ2v on line 6
Process exited with code 255.
Output for 5.6.13, 5.6.15, 5.6.23, 5.6.27, 5.6.30
DateTime Object ( [date] => 2017-07-06 09:43:37.006900 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Call to a member function format() on null in /in/HQZ2v on line 6
Process exited with code 255.
Output for 5.6.11, 5.6.29
DateTime Object ( [date] => 2017-07-06 09:43:37.007000 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Call to a member function format() on null in /in/HQZ2v on line 6
Process exited with code 255.
Output for 5.6.28
DateTime Object ( [date] => 2017-07-06 09:43:37.005800 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Call to a member function format() on null in /in/HQZ2v on line 6
Process exited with code 255.
Output for 5.6.26
DateTime Object ( [date] => 2017-07-06 09:43:37.007100 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Call to a member function format() on null in /in/HQZ2v on line 6
Process exited with code 255.
Output for 5.6.25
DateTime Object ( [date] => 2017-07-06 09:43:37.005200 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Call to a member function format() on null in /in/HQZ2v on line 6
Process exited with code 255.
Output for 5.6.9, 5.6.24
DateTime Object ( [date] => 2017-07-06 09:43:37.006700 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Call to a member function format() on null in /in/HQZ2v on line 6
Process exited with code 255.
Output for 5.6.3, 5.6.17, 5.6.22
DateTime Object ( [date] => 2017-07-06 09:43:37.006100 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Call to a member function format() on null in /in/HQZ2v on line 6
Process exited with code 255.
Output for 5.6.21
DateTime Object ( [date] => 2017-07-06 09:43:37.007400 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Call to a member function format() on null in /in/HQZ2v on line 6
Process exited with code 255.
Output for 5.6.20
DateTime Object ( [date] => 2017-07-06 09:43:37.005500 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Call to a member function format() on null in /in/HQZ2v on line 6
Process exited with code 255.
Output for 5.6.19
DateTime Object ( [date] => 2017-07-06 09:43:37.013500 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Call to a member function format() on null in /in/HQZ2v on line 6
Process exited with code 255.
Output for 5.6.6, 5.6.18
DateTime Object ( [date] => 2017-07-06 09:43:37.005600 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Call to a member function format() on null in /in/HQZ2v on line 6
Process exited with code 255.
Output for 5.6.16
DateTime Object ( [date] => 2017-07-06 09:43:37.007200 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Call to a member function format() on null in /in/HQZ2v on line 6
Process exited with code 255.
Output for 5.6.14
DateTime Object ( [date] => 2017-07-06 09:43:37.008800 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Call to a member function format() on null in /in/HQZ2v on line 6
Process exited with code 255.
Output for 5.6.12
DateTime Object ( [date] => 2017-07-06 09:43:37.011500 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Call to a member function format() on null in /in/HQZ2v on line 6
Process exited with code 255.
Output for 5.6.10
DateTime Object ( [date] => 2017-07-06 09:43:37.007700 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Call to a member function format() on null in /in/HQZ2v on line 6
Process exited with code 255.
Output for 5.6.0, 5.6.7 - 5.6.8
DateTime Object ( [date] => 2017-07-06 09:43:37.006800 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Call to a member function format() on null in /in/HQZ2v on line 6
Process exited with code 255.
Output for 5.6.5
DateTime Object ( [date] => 2017-07-06 09:43:37.005900 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Call to a member function format() on null in /in/HQZ2v on line 6
Process exited with code 255.
Output for 5.6.4
DateTime Object ( [date] => 2017-07-06 09:43:37.006500 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Call to a member function format() on null in /in/HQZ2v on line 6
Process exited with code 255.
Output for 5.6.2
DateTime Object ( [date] => 2017-07-06 09:43:37.006600 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Call to a member function format() on null in /in/HQZ2v on line 6
Process exited with code 255.
Output for 5.6.1
DateTime Object ( [date] => 2017-07-06 09:43:37.007500 [timezone_type] => 1 [timezone] => +00:00 ) Notice: Undefined variable: time in /in/HQZ2v on line 6 Fatal error: Call to a member function format() on null in /in/HQZ2v on line 6
Process exited with code 255.