3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $originalDate = new DateTimeImmutable('2011-11-11'); $modifiedDate = $originalDate->modify('+1 year'); assert($originalDate !== $modifiedDate); assert($modifiedDate->format('Y-m-d') === '2012-11-11'); assert($originalDate->format('Y-m-d') === '2011-11-11');
Output for 5.5.0 - 7.3.0rc4
Output for 5.0.0 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/0huDm on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetimeimmutable in /in/0huDm on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetimeimmutable in /in/0huDm on line 3