3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php const DB_DATETIME_FORMAT = 'Y-m-d H:i:s'; $gmtTimezone = new DateTimeZone("UTC"); print_r($gmtTimezone, true); $Now = DateTime::createFromFormat(DB_DATETIME_FORMAT, 'tomorrow 03:00:00', $gmtTimezone); print_r($Now, true); $Duration = new DateInterval('PT1M'); // 1minute $Now->add( $Duration ); print_r($Now, true); $Duration = new DateInterval('P1D'); // 1Day $Now->add( $Duration ); print_r($Now, true); // 2014-05-12
based on d4UZ9
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to a member function add() on boolean in /in/DFuI4:9 Stack trace: #0 {main} thrown in /in/DFuI4 on line 9
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Fatal error: Call to a member function add() on boolean in /in/DFuI4 on line 9
Process exited with code 255.
Output for 5.3.20 - 5.5.35
Fatal error: Call to a member function add() on a non-object in /in/DFuI4 on line 9
Process exited with code 255.