3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime(); $date->add('+2 days'); var_dump($date);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught TypeError: DateTime::add(): Argument #1 ($interval) must be of type DateInterval, string given in /in/NibAJ:4 Stack trace: #0 /in/NibAJ(4): DateTime->add('+2 days') #1 {main} thrown in /in/NibAJ on line 4
Process exited with code 255.
Output for 7.4.33
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.003023" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.32
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.005055" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.30
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.002961" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.29
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.003371" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.28
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.003334" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.27
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.003616" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.26
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.004450" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.25
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.003808" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.24
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.003529" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.23
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.003005" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.22
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.009604" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.21
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.007422" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.20
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.003644" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.19
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.003224" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.16
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.009196" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.15
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.012863" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.14
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.009514" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.13
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.008586" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.12
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.009901" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.11
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.008556" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.10
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.011779" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.9
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.009047" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.8
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.008675" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.7
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.007645" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.6
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.000236" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.5
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.002036" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.4
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.008285" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.3
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.008006" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.4.0
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.000243" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.33
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 13:56:10.002605" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" }
Output for 7.3.32
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 13:56:10.002370" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" }
Output for 7.3.31
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.003245" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.30
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.003556" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.29
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.009158" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.28
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.008642" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.27
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.009974" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.26
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.009250" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.25
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.008769" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.24
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.008894" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.23
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.009349" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.21
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.009039" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.20
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.008778" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.19
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.012750" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.18
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.005208" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.17
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.010673" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.16
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.008685" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.12
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.000161" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.33
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.011545" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.32
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.009723" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.31
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.009107" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.30
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.008712" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.2.29
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(26) "2013-09-10 15:56:10.013502" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.19, 5.5.0 - 5.5.3
Warning: DateTime::add() expects parameter 1 to be DateInterval, string given in /in/NibAJ on line 4 object(DateTime)#1 (3) { ["date"]=> string(19) "2013-09-10 15:56:10" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::add() in /in/NibAJ on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/NibAJ on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/NibAJ on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/NibAJ on line 3

preferences:
215.96 ms | 401 KiB | 247 Q