3v4l.org

run code in 200+ php & hhvm versions
<?php $period = new DatePeriod(new DateTimeImmutable("now"), new DateInterval("P2Y4DT6H8M"), 2); var_dump($period->getEndDate());
Output for 5.6.20 - 5.6.30, 7.0.5 - 7.2.6
NULL
Output for 5.6.5 - 5.6.19, 7.0.0 - 7.0.4

Process exited with code 139.
Output for hhvm-3.17.3, hhvm-3.18.5 - 3.19.2, hhvm-3.21.0, hhvm-3.22.0
object(DateTimeImmutable)#12 (1) { ["data":"DateTimeImmutable":private]=> object(DateTime)#13 (3) { ["date"]=> string(26) "2018-04-13 16:39:26.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } }
Output for hhvm-3.15.4, hhvm-3.18.4, hhvm-3.20.2, hhvm-3.21.3
object(DateTimeImmutable)#12 (1) { ["data":"DateTimeImmutable":private]=> object(DateTime)#13 (3) { ["date"]=> string(26) "2018-04-13 16:39:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } }
Output for hhvm-3.11.1 - 3.13.2
Fatal error: Uncaught Error: Call to undefined method DatePeriod::getEndDate() in /in/GtdTc:5 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.5.0 - 5.6.4, hhvm-3.10.1
Fatal error: Call to undefined method DatePeriod::getEndDate() in /in/GtdTc on line 5
Process exited with code 255.
Output for 5.3.0 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/GtdTc on line 3
Process exited with code 255.
Output for 5.0.0 - 5.2.17
Fatal error: Class 'DatePeriod' not found in /in/GtdTc on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: dateperiod in /in/GtdTc on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: dateperiod in /in/GtdTc on line 3