3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $d = new \DateTime('sunday'); $m = new \DateTime('tuesday'); $m2 = (clone $d)->modify('next tuesday'); var_dump($d, $m, $m2);
Output for hhvm-3.15.4 - 3.22.0, 7.0.0 - 7.2.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-16 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#2 (3) { ["date"]=> string(26) "2017-07-11 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2017-07-18 00:00:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.30
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /in/iZdZ0 on line 5
Process exited with code 255.