3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function GetFormattedMicroTime($timestamp = false) { return DateTime::createFromFormat('u','5')->format('Y-m-d\TH:i:s.u'); } $test = GetFormattedMicroTime(); print_r($test);
Output for 7.0.14 - 7.1.0
2014-06-23T17:59:42.500000
Output for 7.0.6
2016-05-03T15:26:40.500000
Output for 7.0.5
2016-04-03T04:02:34.500000
Output for 7.0.4
2016-03-10T15:26:56.500000
Output for 7.0.3
2016-03-18T16:07:18.500000
Output for 7.0.2
2016-03-22T22:13:09.500000
Output for 7.0.1
2016-03-24T02:34:01.500000
Output for 7.0.0
2016-03-27T04:33:09.500000
Output for hhvm-3.12.0
2016-04-01T01:38:20.500000
Output for hhvm-3.10.0
2016-03-30T20:50:23.500000
Output for 5.6.21
2016-05-02T10:38:02.500000
Output for 5.6.20
2016-04-10T02:58:44.500000
Output for 5.6.19
2016-03-07T23:10:50.500000
Output for 5.6.18
2016-03-15T08:03:31.500000
Output for 5.6.17
2016-03-19T20:00:09.500000
Output for 5.6.16
2016-03-28T05:22:09.500000
Output for 5.6.15
2016-03-29T06:14:36.500000
Output for 5.6.14
2016-04-02T08:16:01.500000
Output for 5.6.13
2016-04-15T12:28:00.500000
Output for 5.6.12
2016-04-20T02:48:53.500000
Output for 5.6.11
2016-04-23T09:23:39.500000
Output for 5.6.10
2016-04-25T11:16:27.500000
Output for 5.6.9
2016-04-27T16:22:44.500000
Output for 5.6.8
2016-04-30T00:59:46.500000
Output for 5.5.35
2016-05-22T15:17:32.500000
Output for 5.5.34
2016-04-11T05:14:07.500000
Output for 5.5.33
2016-03-09T02:15:56.500000
Output for 5.5.32
2016-03-17T11:35:50.500000
Output for 5.5.31
2016-03-20T22:45:24.500000
Output for 5.5.30
2016-04-01T08:08:23.500000
Output for 5.5.29
2016-04-17T02:47:45.500000
Output for 5.5.28
2016-04-21T05:59:54.500000
Output for 5.5.27
2016-04-22T08:00:58.500000
Output for 5.5.26
2016-04-26T13:55:09.500000
Output for 5.5.25
2016-04-28T20:31:47.500000
Output for 5.5.24
2016-05-24T03:31:45.500000
Output for 5.4.45
2015-09-09T10:20:38.500000
Output for 5.4.44
2015-08-27T14:06:34.500000
Output for 5.4.43
2015-07-11T00:49:20.500000
Output for 5.4.42
2015-06-29T10:18:33.500000
Output for 5.4.41
2015-06-10T03:02:52.500000
Output for 5.4.40
2015-06-10T03:02:47.500000
Output for 5.4.39
2015-06-10T03:02:46.500000
Output for 5.4.38
2015-06-10T03:02:45.500000
Output for 5.4.36 - 5.4.37
2015-02-06T07:10:19.500000
Output for 5.4.34 - 5.4.35
2014-11-16T07:15:32.500000
Output for 5.4.32
2014-09-04T06:16:33.500000
Output for 5.4.31
2014-09-04T06:16:32.500000
Output for 5.4.30
2014-09-04T06:16:29.500000
Output for 5.4.18 - 5.4.29
2014-06-23T17:59:46.500000
Output for 5.3.26 - 5.3.28, 5.4.0 - 5.4.17
2014-06-23T17:59:47.500000
Output for 5.3.29
2014-09-04T06:16:30.500000
Output for 5.3.5 - 5.3.25
2014-06-23T17:59:48.500000
Output for 5.3.3 - 5.3.4
2014-06-23T17:59:49.500000
Output for 5.3.1 - 5.3.2
Fatal error: Call to a member function format() on a non-object in /in/eJeWF on line 3
Process exited with code 255.
Output for 5.3.0
2014-06-23T17:59:49.5000000
Output for 5.2.10 - 5.2.17
Fatal error: Call to undefined method DateTime::createFromFormat() in /in/eJeWF on line 3
Process exited with code 255.
Output for 5.2.0 - 5.2.9
Fatal error: Call to undefined method DateTime::createfromformat() in /in/eJeWF on line 3
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/eJeWF on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/eJeWF on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/eJeWF on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/eJeWF on line 3
Process exited with code 255.