3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $expected = new DateTimeImmutable('2015-08-31 01:02:04.456790'); var_dump($expected); $start = new DateTimeImmutable('2015-08-31 01:02:03.456789'); var_dump($start); $date = $start->modify('+1000001 microseconds'); var_dump($date); var_dump($expected == $date); var_dump($expected < $date); var_dump($expected > $date);
Output for 7.2.0 - 7.3.0rc3
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2015-08-31 01:02:04.456790" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2015-08-31 01:02:03.456789" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#3 (3) { ["date"]=> string(26) "2015-08-31 01:02:04.456790" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(true) bool(false) bool(false)
Output for 7.1.0 - 7.1.21
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2015-08-31 01:02:04.456790" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2015-08-31 01:02:03.456789" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#3 (3) { ["date"]=> string(26) "2015-08-31 01:02:04.456790" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } bool(false) bool(false) bool(true)
Output for 5.6.30, 7.0.0 - 7.0.31
object(DateTimeImmutable)#1 (3) { ["date"]=> string(26) "2015-08-31 01:02:04.456790" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2015-08-31 01:02:03.456789" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Warning: DateTimeImmutable::modify(): Failed to parse time string (+1000001 microseconds) at position 5 (0): Unexpected character in /in/L030c on line 7 bool(false) bool(false) bool(false) bool(true)
Output for hhvm-3.21.3 - 3.22.0
object(DateTimeImmutable)#1 (1) { ["data":"DateTimeImmutable":private]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2015-08-31 01:02:04.456790" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } } object(DateTimeImmutable)#3 (1) { ["data":"DateTimeImmutable":private]=> object(DateTime)#4 (3) { ["date"]=> string(26) "2015-08-31 01:02:03.456789" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } } Warning: DateTime::modify(): Failed to parse time string (+1000001 microseconds) at position 5 (0): Unexpected character in /in/L030c on line -1 object(DateTimeImmutable)#5 (1) { ["data":"DateTimeImmutable":private]=> object(DateTime)#6 (3) { ["date"]=> string(26) "2015-08-31 01:02:03.456789" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } } bool(false) bool(false) bool(true)
Output for hhvm-3.19.2 - 3.21.0
object(DateTimeImmutable)#1 (1) { ["data":"DateTimeImmutable":private]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2015-08-31 01:02:04.456790" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } } object(DateTimeImmutable)#3 (1) { ["data":"DateTimeImmutable":private]=> object(DateTime)#4 (3) { ["date"]=> string(26) "2015-08-31 01:02:03.456789" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } } Warning: DateTime::modify(): Failed to parse time string (+1000001 microseconds) at position 5 (0): Unexpected character in /in/L030c on line 7 object(DateTimeImmutable)#5 (1) { ["data":"DateTimeImmutable":private]=> object(DateTime)#6 (3) { ["date"]=> string(26) "2015-08-31 01:02:03.456789" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } } bool(false) bool(false) bool(true)
Output for hhvm-3.15.4 - 3.18.5
object(DateTimeImmutable)#1 (1) { ["data":"DateTimeImmutable":private]=> object(DateTime)#2 (3) { ["date"]=> string(26) "2015-08-31 01:02:04.456790" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } } object(DateTimeImmutable)#3 (1) { ["data":"DateTimeImmutable":private]=> object(DateTime)#4 (3) { ["date"]=> string(26) "2015-08-31 01:02:03.456789" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } } Warning: DateTime::modify(): Failed to parse time string (+1000001 microseconds) at position 5 (0): Unexpected character object(DateTimeImmutable)#5 (1) { ["data":"DateTimeImmutable":private]=> object(DateTime)#6 (3) { ["date"]=> string(26) "2015-08-31 01:02:03.456789" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } } bool(false) bool(false) bool(true)