3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo (new DateInterval('PT3H12345S'))->format('%h:%i:%s'); echo DateInterval::createFromDateString('12345 seconds')->format('%h:%i:%s'); $d = new DateInterval('PT0S'); $d->addSeconds(12345);
Output for 7.0.0 - 7.2.0
3:0:123450:0:12345 Fatal error: Uncaught Error: Call to undefined method DateInterval::addSeconds() in /in/WvaN4:6 Stack trace: #0 {main} thrown in /in/WvaN4 on line 6
Process exited with code 255.
Output for 5.4.9 - 5.6.28
3:0:123450:0:12345 Fatal error: Call to undefined method DateInterval::addSeconds() in /in/WvaN4 on line 6
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/WvaN4 on line 2
Process exited with code 255.