3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump( $dateTo = new \DateTime('tomorrow') ) var_dump( $dateFrom = new \DateTime('-1 week');) ) var_dump( (new \DateTime('2015-03-04'))->format('H:i') ); var_dump( \DateTime::createFromFormat('Y-m-d', '2015-03-04')->format('H:i') ); var_dump( \DateTime::createFromFormat('!Y-m-d', '2015-03-04')->format('H:i') ); var_dump( \DateTime::createFromFormat('|Y-m-d', '2015-03-04')->format('H:i') );
based on rJHfk
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.1.6
Parse error: syntax error, unexpected 'var_dump' (T_STRING) in /in/4X27n on line 7
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected T_STRING in /in/4X27n:7 Stack trace: #0 {main}
Process exited with code 255.