3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function GetFormattedMicroTime($timestamp = false) { if(!$timestamp) $timestamp = microtime(true); sprintf('%.f', $timestamp); return DateTime::createFromFormat('U.u',sprintf('%.f', $timestamp))->format('Y-m-d\TH:i:s.u'); } $test = GetFormattedMicroTime(); print_r($test);
Output for 7.1.0
2014-06-23T15:51:11.004043
Output for 7.0.14
2014-06-23T15:51:11.003869
Output for 7.0.6
2016-05-02T21:43:53.540122
Output for 7.0.5
2016-04-02T11:19:45.211614
Output for 7.0.4
2016-03-09T21:11:46.704086
Output for 7.0.3
2016-03-17T21:35:02.066343
Output for 7.0.2
2016-03-21T08:19:29.646518
Output for 7.0.1
2016-03-23T07:57:37.451645
Output for 7.0.0
2016-03-26T11:08:51.552511
Output for hhvm-3.12.0
2016-03-11T00:28:32.264276
Output for hhvm-3.10.0
2016-03-29T13:49:33.269204
Output for 5.6.28
2014-06-23T15:51:11.004555
Output for 5.6.21
2016-05-01T16:49:58.422573
Output for 5.6.20
2016-04-09T06:36:38.133851
Output for 5.6.19
2016-03-06T18:20:43.206066
Output for 5.6.18
2016-03-14T06:34:03.099339
Output for 5.6.17
2016-03-19T02:11:29.427370
Output for 5.6.16
2016-03-27T11:51:09.837265
Output for 5.6.15
2016-03-28T12:43:41.646379
Output for 5.6.14
2016-04-01T15:34:07.699836
Output for 5.6.13
2016-04-14T19:31:07.763556
Output for 5.6.12
2016-04-19T08:31:34.413306
Output for 5.6.11
2016-04-22T15:52:05.500137
Output for 5.6.10
2016-04-24T17:29:42.134895
Output for 5.6.9
2016-04-26T22:27:03.978505
Output for 5.6.8
2016-04-29T06:07:42.517994
Output for 5.6.7
2016-05-24T15:38:32.655405
Output for 5.5.35
2016-05-21T19:59:09.200024
Output for 5.5.34
2016-04-10T12:00:52.525438
Output for 5.5.33
2016-03-08T08:18:37.460464
Output for 5.5.32
2016-03-15T17:21:08.845506
Output for 5.5.31
2016-03-20T05:05:50.448355
Output for 5.5.30
2016-03-31T14:54:29.714830
Output for 5.5.29
2016-04-16T09:29:16.433436
Output for 5.5.28
2016-04-20T11:37:24.877993
Output for 5.5.27
2016-04-21T14:22:51.707497
Output for 5.5.26
2016-04-25T19:43:06.623133
Output for 5.5.25
2016-04-28T01:48:20.491561
Output for 5.5.24
2016-04-30T09:31:32.535427
Output for 5.4.45
2015-09-10T21:48:01.189860
Output for 5.4.44
2015-08-31T09:25:37.293569
Output for 5.4.43
2015-08-31T09:25:33.635462
Output for 5.4.42
2015-08-31T09:25:32.319530
Output for 5.4.41
2015-08-31T09:25:29.996726
Output for 5.4.40
2015-05-02T07:11:45.244265
Output for 5.4.39
2015-05-02T07:11:44.456512
Output for 5.4.38
2015-02-28T22:25:46.559182
Output for 5.4.37
2015-02-06T06:11:53.309754
Output for 5.4.36
2015-02-06T06:11:52.987455
Output for 5.4.35
2014-11-16T06:17:55.589699
Output for 5.4.34
2014-11-16T06:17:55.358507
Output for 5.4.32
2014-09-04T04:18:07.878396
Output for 5.4.31
2014-09-04T04:18:07.242856
Output for 5.4.30
2014-09-04T04:18:06.145485
Output for 5.4.29
2014-06-23T15:51:16.551783
Output for 5.4.28
2014-06-23T15:51:16.613341
Output for 5.4.27
2014-06-23T15:51:16.676241
Output for 5.4.26
2014-06-23T15:51:16.741305
Output for 5.4.25
2014-06-23T15:51:16.787509
Output for 5.4.24
2014-06-23T15:51:16.832436
Output for 5.4.23
2014-06-23T15:51:16.885155
Output for 5.4.22
2014-06-23T15:51:16.956733
Output for 5.4.21
2014-06-23T15:51:17.019278
Output for 5.4.20
2014-06-23T15:51:17.083557
Output for 5.4.19
2014-06-23T15:51:17.146605
Output for 5.4.18
2014-06-23T15:51:17.213030
Output for 5.4.17
2014-06-23T15:51:17.276743
Output for 5.4.16
2014-06-23T15:51:17.335694
Output for 5.4.15
2014-06-23T15:51:17.396513
Output for 5.4.14
2014-06-23T15:51:17.460059
Output for 5.4.13
2014-06-23T15:51:17.519118
Output for 5.4.12
2014-06-23T15:51:17.581165
Output for 5.4.11
2014-06-23T15:51:17.643181
Output for 5.4.10
2014-06-23T15:51:17.702486
Output for 5.4.9
2014-06-23T15:51:17.765795
Output for 5.4.8
2014-06-23T15:51:17.815164
Output for 5.4.7
2014-06-23T15:51:17.858976
Output for 5.4.6
2014-06-23T15:51:17.904929
Output for 5.4.5
2014-06-23T15:51:17.949531
Output for 5.4.4
2014-06-23T15:51:17.992707
Output for 5.4.3
2014-06-23T15:51:18.042551
Output for 5.4.2
2014-06-23T15:51:18.092362
Output for 5.4.1
2014-06-23T15:51:18.136202
Output for 5.4.0
2014-06-23T15:51:18.181116
Output for 5.3.29
2014-09-04T04:18:06.331132
Output for 5.3.28
2014-06-23T15:51:18.227934
Output for 5.3.27
2014-06-23T15:51:18.275516
Output for 5.3.26
2014-06-23T15:51:18.324483
Output for 5.3.25
2014-06-23T15:51:18.371659
Output for 5.3.24
2014-06-23T15:51:18.417708
Output for 5.3.23
2014-06-23T15:51:18.462667
Output for 5.3.22
2014-06-23T15:51:18.507241
Output for 5.3.21
2014-06-23T15:51:18.554617
Output for 5.3.20
2014-06-23T15:51:18.622337
Output for 5.3.19
2014-06-23T15:51:18.685536
Output for 5.3.18
2014-06-23T15:51:18.748938
Output for 5.3.17
2014-06-23T15:51:18.812683
Output for 5.3.16
2014-06-23T15:51:18.876317
Output for 5.3.15
2014-06-23T15:51:18.941014
Output for 5.3.14
2014-06-23T15:51:19.004627
Output for 5.3.13
2014-06-23T15:51:19.070615
Output for 5.3.12
2014-06-23T15:51:19.136193
Output for 5.3.11
2014-06-23T15:51:19.214992
Output for 5.3.10
2014-06-23T15:51:19.296870
Output for 5.3.9
2014-06-23T15:51:19.348908
Output for 5.3.8
2014-06-23T15:51:19.401002
Output for 5.3.7
2014-06-23T15:51:19.451835
Output for 5.3.6
2014-06-23T15:51:19.498670
Output for 5.3.5
2014-06-23T15:51:19.545467
Output for 5.3.4
2014-06-23T15:51:19.590680
Output for 5.3.3
2014-06-23T15:51:19.634706
Output for 5.3.2
2014-06-23T15:51:19.680539
Output for 5.3.1
2014-06-23T15:51:19.725794
Output for 5.3.0
Fatal error: Call to a member function format() on a non-object in /in/qrcIN on line 6
Process exited with code 255.
Output for 5.2.10 - 5.2.17
Fatal error: Call to undefined method DateTime::createFromFormat() in /in/qrcIN on line 6
Process exited with code 255.
Output for 5.2.0 - 5.2.9
Fatal error: Call to undefined method DateTime::createfromformat() in /in/qrcIN on line 6
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/qrcIN on line 6
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/qrcIN on line 6
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/qrcIN on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/qrcIN on line 6
Process exited with code 255.