3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo (new \DateTime())->format('Y-m-d H:i:s.u'); echo json_encode(\DateTime::createFromFormat('Y-m-d H:i:s.u','2016-07-04 00:00:00.000000'));
based on OQFis
Output for 7.3.1
2017-07-11 16:04:24.028216{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.3.0
2017-07-11 16:04:24.061440{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.2.13
2017-07-11 16:04:24.049536{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.2.12
2017-07-11 16:04:24.039488{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.2.11
2017-07-11 16:04:24.117415{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.2.10
2017-07-11 16:04:24.019840{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.2.9
2017-07-11 16:04:24.018862{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.2.8
2017-07-11 16:04:24.126694{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.2.7
2017-07-11 16:04:24.091786{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.2.6
2017-07-11 16:04:24.046592{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.2.5
2017-07-11 16:04:24.094330{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.2.4
2017-07-11 16:04:24.137517{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.2.3
2017-07-11 16:04:24.074434{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.2.2
2017-07-11 16:04:24.036546{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.2.1
2017-07-11 16:04:24.000090{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.2.0
2017-07-11 16:04:24.000119{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.1.25
2017-07-11 16:04:24.015513{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.1.20
2017-07-11 16:04:24.002706{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.1.10
2017-07-11 16:04:24.004154{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.1.7
2017-07-11 16:04:24.006163{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.1.6
2017-07-11 16:04:24.031179{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.1.5
2017-07-11 16:04:24.041957{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.1.4
2017-07-11 16:04:24.026610{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 5.6.0 - 5.6.10, 5.6.12 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.0.20, 7.1.3
2017-07-11 16:04:24.000000{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.1.2
2017-07-11 16:04:24.032495{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.1.1
2017-07-11 16:04:24.005226{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 7.1.0
2017-07-11 16:04:24.005986{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}
Output for 5.6.11
2017-07-11 16:04:25.000000{"date":"2016-07-04 00:00:00.000000","timezone_type":3,"timezone":"Europe\/Amsterdam"}