3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new DateTime(); $b = new DateTime('2015-1-31 00:00'); //$a->add(new DateInterval('P6Y')); //echo $a->format('Y-m-d H:i:s'); //echo date('Y-m-d', strtotime('+1 month', strtotime('2015-1-31'))); //echo $a < $b ? 'ja' : 'nein'; //echo date('Y-m-d','2015-1-31' + strtotime('+3 months')); //$a->modify('last day of +2 month'); echo $a->format('Y-m-d H:i:s');
Output for 5.6.28, 7.0.14 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
2015-04-16 16:07:57
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 2015-04-16 16:07:57
Output for 7.3.32 - 7.3.33, 8.0.13
2015-04-16 14:07:57
Output for 7.0.6
2016-05-21 14:49:29
Output for 7.0.5
2016-04-03 10:37:58
Output for 7.0.4
2016-03-10 22:48:59
Output for 7.0.3
2016-03-19 00:28:49
Output for 7.0.2
2016-03-23 06:34:04
Output for 7.0.1
2016-03-24 09:34:53
Output for 7.0.0
2016-03-27 11:24:15
Output for 5.6.21
2016-05-02 17:34:42
Output for 5.6.20
2016-04-10 09:40:43
Output for 5.6.19
2016-03-08 06:58:21
Output for 5.6.18
2016-03-15 16:00:40
Output for 5.6.17
2016-03-20 03:39:49
Output for 5.6.16
2016-03-28 12:14:06
Output for 5.6.15
2016-03-29 13:03:42
Output for 5.6.14
2016-04-14 18:46:27
Output for 5.6.13
2016-04-15 19:29:53
Output for 5.6.12
2016-04-20 10:19:56
Output for 5.6.11
2016-04-24 16:24:25
Output for 5.6.10
2016-04-25 18:29:27
Output for 5.6.9
2016-04-27 23:59:19
Output for 5.6.8
2016-04-30 08:22:59
Output for 5.5.35
2016-05-23 04:19:05
Output for 5.5.34
2016-04-11 11:55:09
Output for 5.5.33
2016-03-09 10:06:56
Output for 5.5.32
2016-03-17 20:02:47
Output for 5.5.31
2016-03-21 06:52:21
Output for 5.5.30
2016-04-01 14:54:01
Output for 5.5.29
2016-04-17 09:42:33
Output for 5.5.28
2016-04-21 13:19:24
Output for 5.5.27
2016-04-22 14:53:23
Output for 5.5.26
2016-04-26 21:12:28
Output for 5.5.25
2016-04-29 04:40:42
Output for 5.5.24
2016-05-24 11:09:57
Output for 5.4.45
2016-02-01 15:56:15
Output for 5.4.44
2016-02-01 15:56:18
Output for 5.4.43
2016-02-01 15:56:20
Output for 5.4.42
2016-02-01 15:56:21
Output for 5.4.41
2016-02-01 15:56:22
Output for 5.4.40
2016-02-01 15:56:26
Output for 5.4.39
2016-02-01 15:56:29
Output for 5.4.38
2016-02-01 15:56:30
Output for 5.4.37
2016-02-01 15:56:33
Output for 5.4.36
2016-02-01 15:56:34
Output for 5.4.35
2016-02-01 15:56:36
Output for 5.4.34
2016-02-01 15:56:37
Output for 5.4.32
2016-02-01 15:56:40
Output for 5.3.29, 5.4.31
2016-02-01 15:56:41
Output for 5.4.30
2016-02-01 15:56:43
Output for 5.4.29
2016-02-01 15:56:44
Output for 5.4.28
2016-02-01 15:56:45
Output for 5.4.27
2016-02-01 15:56:46
Output for 5.4.26
2016-02-01 15:56:47
Output for 5.4.25
2016-02-01 15:56:48
Output for 5.4.24
2016-02-01 15:56:49
Output for 5.4.23
2016-02-01 15:56:50
Output for 5.4.21 - 5.4.22
2016-02-01 15:56:53
Output for 5.4.20
2016-02-01 15:56:54
Output for 5.4.19
2016-02-01 15:56:56
Output for 5.4.18
2016-02-01 15:56:57
Output for 5.3.27, 5.4.17
2016-02-01 15:56:59
Output for 5.3.25, 5.4.15 - 5.4.16
2016-02-01 15:57:01
Output for 5.3.24, 5.4.14
2016-02-01 15:57:02
Output for 5.3.23, 5.4.13
2016-02-01 15:57:03
Output for 5.3.22, 5.4.12
2016-02-01 15:57:04
Output for 5.3.20 - 5.3.21, 5.4.10 - 5.4.11
2016-02-01 15:57:05
Output for 5.3.18 - 5.3.19, 5.4.9
2016-02-01 15:57:06
Output for 5.3.17, 5.4.8
2016-02-01 15:57:07
Output for 5.4.6 - 5.4.7
2016-02-01 15:57:08
Output for 5.3.14, 5.4.5
2016-02-01 15:57:10
Output for 5.4.4
2016-02-01 15:57:11
Output for 5.3.13, 5.4.3
2016-02-01 15:57:12
Output for 5.3.11, 5.4.2
2016-02-01 15:57:14
Output for 5.3.10, 5.4.0 - 5.4.1
2016-02-01 15:57:15
Output for 5.3.28
2016-02-01 15:56:51
Output for 5.3.26
2016-02-01 15:57:00
Output for 5.3.15 - 5.3.16
2016-02-01 15:57:09
Output for 5.3.12
2016-02-01 15:57:13
Output for 5.3.7 - 5.3.9
2016-02-01 15:57:16
Output for 5.3.5 - 5.3.6
2016-02-01 15:57:17
Output for 5.3.4
2016-02-01 15:57:19
Output for 5.2.15, 5.3.3
2016-02-01 15:57:20
Output for 5.2.14, 5.3.2
2016-02-01 15:57:21
Output for 5.2.11, 5.3.1
2016-02-01 15:57:23
Output for 5.2.10, 5.3.0
2016-02-01 15:57:24
Output for 5.2.16 - 5.2.17
2016-02-01 15:57:18
Output for 5.2.12 - 5.2.13
2016-02-01 15:57:22
Output for 5.2.8 - 5.2.9
2016-02-01 15:57:25
Output for 5.2.7
2016-02-01 15:57:26
Output for 5.2.5 - 5.2.6
2016-02-01 15:57:27
Output for 5.2.3 - 5.2.4
2016-02-01 15:57:28
Output for 5.2.2
2016-02-01 15:57:29
Output for 5.2.0 - 5.2.1
2016-02-01 15:57:30
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/sEZIC 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/sEZIC 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/sEZIC on line 3

preferences:
218.26 ms | 401 KiB | 312 Q