3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function GetFormattedMicroTime($timestamp = false) { if(!$timestamp) $timestamp = microtime(true); print_r(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.2.0
1403538704.0031562014-06-23T15:51:44.003156
Output for 7.1.7
1403538704.0035892014-06-23T15:51:44.003589
Output for 7.1.6
1403538704.0087552014-06-23T15:51:44.008755
Output for 7.1.5
1403538704.0121452014-06-23T15:51:44.012145
Output for 7.1.0
1403538704.0041242014-06-23T15:51:44.004124
Output for 7.0.20
1403538704.0023542014-06-23T15:51:44.002354
Output for 7.0.14
1403538704.0036812014-06-23T15:51:44.003681
Output for 7.0.6
1462284250.4554312016-05-03T14:04:10.455431
Output for 7.0.5
1459651017.8244152016-04-03T02:36:57.824415
Output for 7.0.4
1457622476.4244692016-03-10T15:07:56.424469
Output for 7.0.3
1458316163.3332972016-03-18T15:49:23.333297
Output for 7.0.2
1458683765.7243222016-03-22T21:56:05.724322
Output for 7.0.1
1458785524.3192832016-03-24T02:12:04.319283
Output for 7.0.0
1459048186.2914702016-03-27T03:09:46.291470
Output for 5.6.28
1403538704.0046252014-06-23T15:51:44.004625
Output for 5.6.21
1462180476.9116642016-05-02T09:14:36.911664
Output for 5.6.20
1460252044.4311982016-04-10T01:34:04.431198
Output for 5.6.19
1457390957.2056482016-03-07T22:49:17.205648
Output for 5.6.18
1458027952.6452202016-03-15T07:45:52.645220
Output for 5.6.17
1458416385.2509352016-03-19T19:39:45.250935
Output for 5.6.16
1459137484.2575142016-03-28T03:58:04.257514
Output for 5.6.15
1459226978.1163512016-03-29T04:49:38.116351
Output for 5.6.14
1459579731.8892592016-04-02T06:48:51.889259
Output for 5.6.13
1460718210.2648552016-04-15T11:03:30.264855
Output for 5.6.12
1461115615.2732442016-04-20T01:26:55.273244
Output for 5.6.11
1461398345.4168092016-04-23T07:59:05.416809
Output for 5.6.10
1461577987.4103202016-04-25T09:53:07.410320
Output for 5.6.9
1461769217.4325722016-04-27T15:00:17.432572
Output for 5.6.8
1461973277.0902242016-04-29T23:41:17.090224
Output for 5.5.35
1463926186.2363842016-05-22T14:09:46.236384
Output for 5.5.34
1460346508.4514422016-04-11T03:48:28.451442
Output for 5.5.33
1457488515.7159492016-03-09T01:55:15.715949
Output for 5.5.32
1458214013.8557172016-03-17T11:26:53.855717
Output for 5.5.31
1458512729.6367312016-03-20T22:25:29.636731
Output for 5.5.30
1459492987.4304452016-04-01T06:43:07.430445
Output for 5.5.29
1460856298.5214852016-04-17T01:24:58.521485
Output for 5.5.28
1461213452.1938582016-04-21T04:37:32.193858
Output for 5.5.27
1461306954.5555112016-04-22T06:35:54.555511
Output for 5.5.26
1461673994.6643702016-04-26T12:33:14.664370
Output for 5.5.25
1461871190.2194822016-04-28T19:19:50.219482
Output for 5.5.24
1464055727.7010462016-05-24T02:08:47.701046
Output for 5.4.45
1445052046.3018382015-10-17T03:20:46.301838
Output for 5.4.44
1445052046.5241792015-10-17T03:20:46.524179
Output for 5.4.43
1445052046.6418332015-10-17T03:20:46.641833
Output for 5.4.42
1445052046.7984302015-10-17T03:20:46.798430
Output for 5.4.41
1445052046.9188802015-10-17T03:20:46.918880
Output for 5.4.40
1445052047.0274512015-10-17T03:20:47.027451
Output for 5.4.39
1445052047.1688352015-10-17T03:20:47.168835
Output for 5.4.38
1445052047.2826152015-10-17T03:20:47.282615
Output for 5.4.37
1445052047.4013702015-10-17T03:20:47.401370
Output for 5.4.36
1445052047.5119212015-10-17T03:20:47.511921
Output for 5.4.35
1445052047.7139372015-10-17T03:20:47.713937
Output for 5.4.34
1445052047.8427142015-10-17T03:20:47.842714
Output for 5.4.32
1445052047.9744112015-10-17T03:20:47.974411
Output for 5.4.31
1445052048.0841202015-10-17T03:20:48.084120
Output for 5.4.30
1445052048.2116262015-10-17T03:20:48.211626
Output for 5.4.29
1445052048.3476482015-10-17T03:20:48.347648
Output for 5.4.28
1445052048.4709282015-10-17T03:20:48.470928
Output for 5.4.27
1445052048.5779302015-10-17T03:20:48.577930
Output for 5.4.26
1445052048.6906272015-10-17T03:20:48.690627
Output for 5.4.25
1445052048.8384572015-10-17T03:20:48.838457
Output for 5.4.24
1445052048.9760012015-10-17T03:20:48.976001
Output for 5.4.23
1445052049.1086782015-10-17T03:20:49.108678
Output for 5.4.22
1445052049.2437232015-10-17T03:20:49.243723
Output for 5.4.21
1445052049.3551052015-10-17T03:20:49.355105
Output for 5.4.20
1445052049.4741632015-10-17T03:20:49.474163
Output for 5.4.19
1445052049.5805432015-10-17T03:20:49.580543
Output for 5.4.18
1445052049.6919872015-10-17T03:20:49.691987
Output for 5.4.17
1445052049.8461152015-10-17T03:20:49.846115
Output for 5.4.16
1445052049.9569622015-10-17T03:20:49.956962
Output for 5.4.15
1445052050.0816362015-10-17T03:20:50.081636
Output for 5.4.14
1445052050.2059162015-10-17T03:20:50.205916
Output for 5.4.13
1445052050.3184832015-10-17T03:20:50.318483
Output for 5.4.12
1445052050.4659382015-10-17T03:20:50.465938
Output for 5.4.11
1445052050.5905942015-10-17T03:20:50.590594
Output for 5.4.10
1445052050.7011142015-10-17T03:20:50.701114
Output for 5.4.9
1445052050.8475192015-10-17T03:20:50.847519
Output for 5.4.8
1445052050.9981482015-10-17T03:20:50.998148
Output for 5.4.7
1445052051.1169252015-10-17T03:20:51.116925
Output for 5.4.6
1445052051.2632632015-10-17T03:20:51.263263
Output for 5.4.5
1445052051.3753502015-10-17T03:20:51.375350
Output for 5.4.4
1445052051.5462462015-10-17T03:20:51.546246
Output for 5.4.3
1445052051.6709212015-10-17T03:20:51.670921
Output for 5.4.2
1445052051.7938922015-10-17T03:20:51.793892
Output for 5.4.1
1445052051.9265432015-10-17T03:20:51.926543
Output for 5.4.0
1445052052.0350132015-10-17T03:20:52.035013
Output for 5.3.29
1445052052.1561032015-10-17T03:20:52.156103
Output for 5.3.28
1445052052.2928332015-10-17T03:20:52.292833
Output for 5.3.27
1445052052.4020902015-10-17T03:20:52.402090
Output for 5.3.26
1445052052.5149632015-10-17T03:20:52.514963
Output for 5.3.25
1445052052.6243422015-10-17T03:20:52.624342
Output for 5.3.24
1445052052.7481452015-10-17T03:20:52.748145
Output for 5.3.23
1445052052.8720652015-10-17T03:20:52.872065
Output for 5.3.22
1445052052.9819392015-10-17T03:20:52.981939
Output for 5.3.21
1445052053.0950252015-10-17T03:20:53.095025
Output for 5.3.20
1445052053.2067062015-10-17T03:20:53.206706
Output for 5.3.19
1445052053.3151602015-10-17T03:20:53.315160
Output for 5.3.18
1445052053.4217072015-10-17T03:20:53.421707
Output for 5.3.17
1445052053.5982782015-10-17T03:20:53.598278
Output for 5.3.16
1445052053.6998242015-10-17T03:20:53.699824
Output for 5.3.15
1445052053.8208192015-10-17T03:20:53.820819
Output for 5.3.14
1445052053.9342952015-10-17T03:20:53.934295
Output for 5.3.13
1445052054.0431192015-10-17T03:20:54.043119
Output for 5.3.12
1445052054.1555292015-10-17T03:20:54.155529
Output for 5.3.11
1445052054.2667282015-10-17T03:20:54.266728
Output for 5.3.10
1445052054.3804722015-10-17T03:20:54.380472
Output for 5.3.9
1445052054.4937912015-10-17T03:20:54.493791
Output for 5.3.8
1445052054.6061152015-10-17T03:20:54.606115
Output for 5.3.7
1445052054.7142562015-10-17T03:20:54.714256
Output for 5.3.6
1445052054.8240952015-10-17T03:20:54.824095
Output for 5.3.5
1445052054.9445542015-10-17T03:20:54.944554
Output for 5.3.4
1445052055.0531202015-10-17T03:20:55.053120
Output for 5.3.3
1445052055.1659102015-10-17T03:20:55.165910
Output for 5.3.2
1445052055.2769682015-10-17T03:20:55.276968
Output for 5.3.1
1445052055.4443602015-10-17T03:20:55.444360
Output for 5.3.0
1445052055.550919 Fatal error: Call to a member function format() on a non-object in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.2.17
1445052055.660098 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.2.16
1445052055.762864 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.2.15
1445052055.867231 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.2.14
1445052056.001930 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.2.13
1445052056.106249 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.2.12
1445052056.206169 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.2.11
1445052056.297112 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.2.10
1445052056.414687 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.2.9
1445052056.551719 Fatal error: Call to undefined method DateTime::createfromformat() in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.2.8
1445052056.646241 Fatal error: Call to undefined method DateTime::createfromformat() in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.2.7
1445052056.769161 Fatal error: Call to undefined method DateTime::createfromformat() in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.2.6
1445052056.875404 Fatal error: Call to undefined method DateTime::createfromformat() in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.2.5
1445052057.110722 Fatal error: Call to undefined method DateTime::createfromformat() in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.2.4
1445052057.358025 Fatal error: Call to undefined method DateTime::createfromformat() in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.2.3
1445052057.603189 Fatal error: Call to undefined method DateTime::createfromformat() in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.2.2
1445052057.832862 Fatal error: Call to undefined method DateTime::createfromformat() in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.2.1
1445052058.106329 Fatal error: Call to undefined method DateTime::createfromformat() in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.2.0
1445052058.361734 Fatal error: Call to undefined method DateTime::createfromformat() in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.1.6
1445052058.631588 Fatal error: Class 'DateTime' not found in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.1.5
1445052058.895708 Fatal error: Class 'DateTime' not found in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.1.4
1445052059.151081 Fatal error: Class 'DateTime' not found in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.1.3
1445052059.396887 Fatal error: Class 'DateTime' not found in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.1.2
1445052059.640267 Fatal error: Class 'DateTime' not found in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.1.1
1445052059.738467 Fatal error: Class 'DateTime' not found in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.1.0
1445052059.845313 Fatal error: Class 'DateTime' not found in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.0.5
1445052059.956068 Fatal error: Class 'DateTime' not found in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.0.4
1445052060.065554 Fatal error: Class 'DateTime' not found in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.0.3
1445052060.182408 Fatal error: Class 'DateTime' not found in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.0.2
1445052060.283369 Fatal error: Class 'DateTime' not found in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.0.1
1445052060.413595 Fatal error: Class 'DateTime' not found in /in/CgN8L on line 6
Process exited with code 255.
Output for 5.0.0
1445052060.606736 Fatal error: Class 'DateTime' not found in /in/CgN8L 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/CgN8L 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/CgN8L on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/CgN8L on line 6
Process exited with code 255.