3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $now = new DateTimeImmutable("2015-03-31"); var_dump($now->format("Y-m-d")); var_dump($now->modify("+1 month")->format("Y-m-d"));
based on UiTEU
Output for 5.5.0 - 5.6.38, hhvm-3.10.1 - 3.22.0, 7.0.0 - 7.3.1
string(10) "2015-03-31" string(10) "2015-05-01"
Output for 5.0.0 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/6cFuj on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/6cFuj on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/6cFuj on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/6cFuj on line 6
Process exited with code 255.