3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $yo = new DateTime(); $dude = (clone $yo)->modify("+13 months"); var_dump($dude);
Output for 7.1.0
object(DateTime)#2 (3) { ["date"]=> string(26) "2014-11-21 11:01:20.006268" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.0.14
object(DateTime)#2 (3) { ["date"]=> string(26) "2014-11-21 11:01:20.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.4.0 - 5.6.28
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /in/gXpLh on line 5
Process exited with code 255.
Output for 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/gXpLh on line 5
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/gXpLh on line 5
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_VARIABLE in /in/gXpLh on line 5
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_VARIABLE in /in/gXpLh on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/gXpLh on line 5
Process exited with code 255.