3v4l.org

run code in 300+ PHP versions simultaneously
<?php $monday = new \DateTime('- 1 tuesday'); var_dump($monday);
Output for 8.3.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.008159" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.010656" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
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 object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.006866" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.007034" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.006975" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003787" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003704" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003795" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.2.18
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.008861" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.2.17
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.007095" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.2.16
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.006999" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.2.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003725" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.2.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003786" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.2.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003804" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.2.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003816" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.2.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.004288" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.2.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.005153" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.2.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.005328" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.2.6, 8.2.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003861" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.2.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.004002" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.2.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.004192" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.2.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003626" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.2.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003840" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.2.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.005208" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.2.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003602" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.2.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003591" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.28
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.009734" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.27
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003528" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.26
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003559" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.25
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003700" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.24
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.005306" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.23
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.004866" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.22
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003670" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.21
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003679" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.004423" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.19
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003831" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.18
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003642" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.17
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003825" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.16
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.004405" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.8, 8.1.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003690" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003834" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003196" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003752" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.004173" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003457" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003892" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003644" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.006439" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.005259" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003724" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003705" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003973" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003622" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.005774" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.30
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003310" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.29
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003497" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.28
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003258" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.27
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003716" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.26
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003177" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.25
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003249" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.24
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003091" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.23
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003382" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.22
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003353" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.10, 8.0.21
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003408" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003894" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.19
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003567" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.18
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003451" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.17
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003813" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.16
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003302" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003448" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003910" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 18:31:29.002023" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" }
Output for 8.0.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003401" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 20:31:29.003984" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33, 8.0.0 - 8.0.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.32 - 7.3.33
object(DateTime)#1 (3) { ["date"]=> string(26) "2018-07-10 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" }

preferences:
172.13 ms | 401 KiB | 203 Q