3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function GetFormattedMicroTime($timestamp = false) { if(!$timestamp) $timestamp = microtime(true); 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:50:08.004030
Output for 7.0.14
2014-06-23T15:50:08.003754
Output for 7.0.6
2016-05-03T07:36:55.179582
Output for 7.0.5
2016-04-02T20:29:36.856902
Output for 7.0.4
2016-03-10T08:00:52.551572
Output for 7.0.3
2016-03-18T08:38:21.704253
Output for 7.0.2
2016-03-22T14:32:10.224020
Output for 7.0.1
2016-03-23T19:18:05.128120
Output for 7.0.0
2016-03-26T20:50:52.674209
Output for hhvm-3.12.0
2016-03-28T22:45:39.733747
Output for hhvm-3.10.0
2016-03-30T09:04:54.801610
Output for 5.6.28
2014-06-23T15:50:08.004582
Output for 5.6.21
2016-05-02T02:58:42.852692
Output for 5.6.20
2016-04-09T19:26:21.507971
Output for 5.6.19
2016-03-07T16:09:53.080776
Output for 5.6.18
2016-03-15T00:03:25.511214
Output for 5.6.17
2016-03-19T12:54:07.042644
Output for 5.6.16
2016-03-27T21:36:07.798903
Output for 5.6.15
2016-03-28T22:41:14.464017
Output for 5.6.14
2016-04-02T01:02:03.428258
Output for 5.6.13
2016-04-15T04:56:23.317212
Output for 5.6.12
2016-04-19T18:40:42.764797
Output for 5.6.11
2016-04-23T01:44:49.006502
Output for 5.6.10
2016-04-25T03:28:18.659971
Output for 5.6.9
2016-04-27T08:26:41.012303
Output for 5.6.8
2016-04-29T16:31:12.384335
Output for 5.5.35
2016-05-22T06:42:23.660039
Output for 5.5.34
2016-04-10T21:46:42.468110
Output for 5.5.33
2016-03-08T19:06:47.405603
Output for 5.5.32
2016-03-17T01:46:49.204914
Output for 5.5.31
2016-03-20T15:39:53.989831
Output for 5.5.30
2016-04-01T00:36:56.116866
Output for 5.5.29
2016-04-16T19:01:41.481242
Output for 5.5.28
2016-04-20T21:46:05.259458
Output for 5.5.27
2016-04-22T00:15:37.143214
Output for 5.5.26
2016-04-26T05:55:26.050871
Output for 5.5.25
2016-04-28T12:13:16.129951
Output for 5.5.24
2016-05-23T19:29:02.361358
Output for 5.4.45
2015-09-20T22:21:47.563943
Output for 5.4.44
2015-09-20T22:21:42.855247
Output for 5.4.43
2015-09-20T22:21:37.369528
Output for 5.4.42
2015-09-20T22:21:35.381507
Output for 5.4.41
2015-09-20T22:21:32.997881
Output for 5.4.40
2015-09-20T22:21:30.526127
Output for 5.4.39
2015-09-20T22:21:28.316094
Output for 5.4.38
2015-03-05T08:17:30.513477
Output for 5.4.37
2015-03-05T08:17:23.938024
Output for 5.4.36
2015-03-05T08:17:23.569627
Output for 5.4.35
2015-03-05T08:17:23.216461
Output for 5.4.34
2015-03-05T08:17:22.866413
Output for 5.4.32
2014-09-04T04:16:53.749443
Output for 5.4.31
2014-09-04T04:16:52.856904
Output for 5.4.30
2014-09-04T04:16:50.548598
Output for 5.4.29
2014-06-23T15:50:14.183788
Output for 5.4.28
2014-06-23T15:50:14.325074
Output for 5.4.27
2014-06-23T15:50:14.419796
Output for 5.4.26
2014-06-23T15:50:14.524998
Output for 5.4.25
2014-06-23T15:50:14.622339
Output for 5.4.24
2014-06-23T15:50:14.743881
Output for 5.4.23
2014-06-23T15:50:14.804450
Output for 5.4.22
2014-06-23T15:50:14.962863
Output for 5.4.21
2014-06-23T15:50:15.031197
Output for 5.4.20
2014-06-23T15:50:15.106934
Output for 5.4.19
2014-06-23T15:50:15.161262
Output for 5.4.18
2014-06-23T15:50:15.232802
Output for 5.4.17
2014-06-23T15:50:15.294288
Output for 5.4.16
2014-06-23T15:50:15.444784
Output for 5.4.15
2014-06-23T15:50:15.509499
Output for 5.4.14
2014-06-23T15:50:15.605153
Output for 5.4.13
2014-06-23T15:50:15.693834
Output for 5.4.12
2014-06-23T15:50:15.833676
Output for 5.4.11
2014-06-23T15:50:15.921300
Output for 5.4.10
2014-06-23T15:50:16.015866
Output for 5.4.9
2014-06-23T15:50:16.096615
Output for 5.4.8
2014-06-23T15:50:16.162021
Output for 5.4.7
2014-06-23T15:50:16.232947
Output for 5.4.6
2014-06-23T15:50:16.285615
Output for 5.4.5
2014-06-23T15:50:16.330045
Output for 5.4.4
2014-06-23T15:50:16.375557
Output for 5.4.3
2014-06-23T15:50:16.428965
Output for 5.4.2
2014-06-23T15:50:16.549949
Output for 5.4.1
2014-06-23T15:50:16.603064
Output for 5.4.0
2014-06-23T15:50:16.666859
Output for 5.3.29
2014-09-04T04:16:50.931997
Output for 5.3.28
2014-06-23T15:50:16.730182
Output for 5.3.27
2014-06-23T15:50:16.827957
Output for 5.3.26
2014-06-23T15:50:16.896417
Output for 5.3.25
2014-06-23T15:50:16.956875
Output for 5.3.24
2014-06-23T15:50:17.021335
Output for 5.3.23
2014-06-23T15:50:17.095547
Output for 5.3.22
2014-06-23T15:50:17.174558
Output for 5.3.21
2014-06-23T15:50:17.327940
Output for 5.3.20
2014-06-23T15:50:17.421703
Output for 5.3.19
2014-06-23T15:50:17.477883
Output for 5.3.18
2014-06-23T15:50:17.557253
Output for 5.3.17
2014-06-23T15:50:17.648623
Output for 5.3.16
2014-06-23T15:50:17.721663
Output for 5.3.15
2014-06-23T15:50:17.841250
Output for 5.3.14
2014-06-23T15:50:17.913709
Output for 5.3.13
2014-06-23T15:50:17.985184
Output for 5.3.12
2014-06-23T15:50:18.050129
Output for 5.3.11
2014-06-23T15:50:18.102850
Output for 5.3.10
2014-06-23T15:50:18.157389
Output for 5.3.9
2014-06-23T15:50:18.222516
Output for 5.3.8
2014-06-23T15:50:18.283804
Output for 5.3.7
2014-06-23T15:50:18.332844
Output for 5.3.6
2014-06-23T15:50:18.394758
Output for 5.3.5
2014-06-23T15:50:18.451089
Output for 5.3.4
2014-06-23T15:50:18.503699
Output for 5.3.3
2014-06-23T15:50:18.549836
Output for 5.3.2
2014-06-23T15:50:18.595487
Output for 5.3.1
2014-06-23T15:50:18.645768
Output for 5.3.0
Fatal error: Call to a member function format() on a non-object in /in/IOlib on line 5
Process exited with code 255.
Output for 5.2.10 - 5.2.17
Fatal error: Call to undefined method DateTime::createFromFormat() in /in/IOlib on line 5
Process exited with code 255.
Output for 5.2.0 - 5.2.9
Fatal error: Call to undefined method DateTime::createfromformat() in /in/IOlib on line 5
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/IOlib on line 5
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/IOlib on line 5
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/IOlib on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/IOlib on line 5
Process exited with code 255.