3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dt = new DateTime; $dt->add('PT2H'); echo $dt->format('Y-m-d H:i');
based on vDHvT
Output for 5.3.19 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2015-10-29 19:51
Output for 7.0.6
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-05-03 18:00
Output for 7.0.5
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-04-03 06:27
Output for 7.0.4
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-03-10 18:13
Output for 7.0.3
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-03-18 19:16
Output for 7.0.2
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-03-23 01:25
Output for 7.0.1
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-03-24 05:09
Output for 7.0.0
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-03-27 07:05
Output for 5.6.21
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-05-02 13:11
Output for 5.6.20
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-04-10 05:27
Output for 5.6.19
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-03-08 02:23
Output for 5.6.18
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-03-15 11:05
Output for 5.6.17
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-03-19 22:45
Output for 5.6.16
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-03-28 07:52
Output for 5.6.15
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-03-29 08:43
Output for 5.6.14
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-04-02 10:36
Output for 5.6.13
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-04-15 14:57
Output for 5.6.12
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-04-20 05:26
Output for 5.6.11
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-04-24 11:42
Output for 5.6.10
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-04-25 13:51
Output for 5.6.9
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-04-27 19:01
Output for 5.6.8
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-04-30 03:54
Output for 5.5.35
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-05-22 19:36
Output for 5.5.34
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-04-11 07:39
Output for 5.5.33
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-03-09 05:00
Output for 5.5.32
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-03-17 14:43
Output for 5.5.31
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-03-21 01:45
Output for 5.5.30
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-04-01 10:37
Output for 5.5.29
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-04-17 05:21
Output for 5.5.28
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-04-21 08:39
Output for 5.5.27
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-04-22 10:28
Output for 5.5.26
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-04-26 16:34
Output for 5.5.25
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-04-28 23:25
Output for 5.5.24
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/dX25c on line 4 2016-05-24 16:17