3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $derivation = new \DateTime('+1 days'); $derivation->sub('+10 days'); echo $derivation->format('Y M D H:i:s');
Output for 5.6.28, 7.0.14 - 7.1.0
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2014 Mar Fri 21:39:22
Output for 7.0.6
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 May Wed 02:14:34
Output for 7.0.5
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Apr Sun 15:29:42
Output for 7.0.4
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Mar Fri 00:58:14
Output for 7.0.3
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Mar Sat 01:10:35
Output for 7.0.2
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Mar Tue 11:45:33
Output for 7.0.1
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Mar Thu 11:57:18
Output for 7.0.0
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Mar Sun 14:28:27
Output for hhvm-3.12.0
Warning: sub() expects parameter 1 to be object, string given in /in/7hDP4 on line 3 2016 Mar Sat 05:32:48
Output for hhvm-3.10.0
Warning: sub() expects parameter 1 to be object, string given in /in/7hDP4 on line 3 2016 Mar Wed 19:25:36
Output for 5.6.21
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 May Mon 21:17:00
Output for 5.6.20
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Apr Sun 10:44:29
Output for 5.6.19
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Mar Mon 23:13:33
Output for 5.6.18
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Mar Tue 10:58:16
Output for 5.6.17
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Mar Sun 05:39:27
Output for 5.6.16
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Mar Mon 16:13:31
Output for 5.6.15
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Mar Tue 17:07:10
Output for 5.6.14
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Apr Sat 19:45:35
Output for 5.6.13
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Apr Fri 23:33:29
Output for 5.6.12
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Apr Wed 12:41:53
Output for 5.6.11
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Apr Sat 19:58:01
Output for 5.6.10
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Apr Mon 21:38:00
Output for 5.6.9
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Apr Thu 02:47:13
Output for 5.6.8
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Apr Sat 10:22:24
Output for 5.6.7
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 May Wed 21:03:41
Output for 5.5.35
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 May Mon 00:38:07
Output for 5.5.34
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Apr Mon 16:40:13
Output for 5.5.33
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Mar Wed 11:52:22
Output for 5.5.32
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Mar Thu 17:33:07
Output for 5.5.31
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Mar Mon 08:32:27
Output for 5.5.30
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Apr Fri 19:08:37
Output for 5.5.29
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Apr Sun 13:40:17
Output for 5.5.28
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Apr Thu 15:56:08
Output for 5.5.27
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Apr Fri 18:29:33
Output for 5.5.26
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Apr Tue 23:55:22
Output for 5.5.25
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 Apr Fri 06:03:57
Output for 5.5.24
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2016 May Sun 13:34:39
Output for 5.4.45
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2015 Sep Tue 05:34:08
Output for 5.4.44
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2015 Sep Tue 05:34:05
Output for 5.4.43
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2015 Sep Tue 05:34:01
Output for 5.4.42
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2015 Sep Tue 05:34:00
Output for 5.4.41
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2015 Sep Tue 05:33:58
Output for 5.4.40
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2015 May Mon 18:26:04
Output for 5.4.39
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2015 May Mon 18:26:03
Output for 5.4.38
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2015 Mar Tue 14:40:17
Output for 5.4.36 - 5.4.37
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2015 Feb Mon 11:21:36
Output for 5.4.34 - 5.4.35
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2015 Feb Mon 11:21:35
Output for 5.4.32
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2014 Sep Mon 12:55:25
Output for 5.4.31
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2014 Sep Mon 12:55:21
Output for 5.3.29, 5.4.30
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2014 Sep Mon 12:55:16
Output for 5.4.28 - 5.4.29
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2014 Sep Mon 12:55:15
Output for 5.4.27
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2014 Sep Mon 12:55:22
Output for 5.4.17 - 5.4.26
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2014 Mar Fri 21:39:23
Output for 5.3.23 - 5.3.28, 5.4.0 - 5.4.16
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2014 Mar Fri 21:39:24
Output for 5.3.2 - 5.3.22
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2014 Mar Fri 21:39:25
Output for 5.3.0 - 5.3.1
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/7hDP4 on line 3 2014 Mar Fri 21:39:26
Output for 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/7hDP4 on line 2 Fatal error: Call to undefined method DateTime::sub() in /in/7hDP4 on line 3
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/7hDP4 on line 2 Fatal error: Class 'DateTime' not found in /in/7hDP4 on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/7hDP4 on line 2 Fatal error: Cannot instantiate non-existent class: datetime in /in/7hDP4 on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/7hDP4 on line 2 Fatal error: Cannot instantiate non-existent class: datetime in /in/7hDP4 on line 2