3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dob = new \DateTimeImmutable('now - 100 years'); usleep(250000); $hundredYearsAgo = new \DateTimeImmutable('now - 100 years'); var_dump($dob); var_dump($hundredYearsAgo); var_dump($dob <= $hundredYearsAgo);
based on M3Du7
Output for 7.3.0beta1
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.002916" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.253037" ["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:05:54.001437" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.251567" ["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:05:54.003042" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.253183" ["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:05:54.002849" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.252945" ["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:05:54.003587" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.253702" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(false)
Output for 7.1.10
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.003486" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.253584" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(false)
Output for 7.1.7
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.005002" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.255089" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(false)
Output for 7.1.6
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.006836" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.256923" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(false)
Output for 7.1.5
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.022905" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.273050" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(false)
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.0.17, 7.1.3
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.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:05:54.030481" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.280628" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(false)
Output for 7.1.1
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.006215" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.260367" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(false)
Output for 7.1.0
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.004507" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.254670" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(false)
Output for 7.0.20
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "1917-03-27 15:05:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "1917-03-27 15:05:55.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:05:54.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:05:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } } bool(true)