3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dob = new \DateTimeImmutable('now - 100 years - 1 second'); $hundredYearsAgo = new \DateTimeImmutable('now - 100 years'); var_dump($dob); var_dump($hundredYearsAgo); var_dump($dob <= $hundredYearsAgo);
based on trmY4
Output for 7.3.0beta1
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:06:10.001413" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:06:11.001419" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(true)
Output for 7.3.0alpha1
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:06:10.003510" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:06:11.003522" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(true)
Output for 7.2.6
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:06:10.004540" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:06:11.004558" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(true)
Output for 7.2.0
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:06:10.003815" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:06:11.003824" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(true)
Output for 7.1.20
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:06:10.003989" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:06:11.003997" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(true)
Output for 7.1.10
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:06:10.004023" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:06:11.004029" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(true)
Output for 7.1.7
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:06:10.027875" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:06:11.027897" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(true)
Output for 7.1.6
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:06:10.052678" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:06:11.052698" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(true)
Output for 7.1.5
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:06:10.055236" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:06:11.055258" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(true)
Output for 7.1.4
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:06:10.053775" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:06:11.053804" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(true)
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.0.17, 7.0.19 - 7.0.20, 7.1.3
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:06:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:06:11.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(true)
Output for 7.1.2
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:06:10.041732" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:06:11.041744" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(true)
Output for 7.1.1
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:06:10.037748" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:06:11.037763" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(true)
Output for 7.1.0
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:06:11.046667" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:06:12.046679" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(true)
Output for 7.0.18
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:06:11.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:06:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(true)
Output for hhvm-3.12.14 - 3.17.3
object(DateTimeImmutable)#1 (1) { ["data":"DateTimeImmutable":private]=> object(DateTime)#2 (3) { ["date"]=> string(26) "1917-03-27 15:06:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } } object(DateTimeImmutable)#3 (1) { ["data":"DateTimeImmutable":private]=> object(DateTime)#4 (3) { ["date"]=> string(26) "1917-03-27 15:06:11.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } } bool(true)