3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime('2016-03-30'); $month = DateInterval::createFromDateString('1 month'); var_dump(DateTime::sub($date, $month));
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Non-static method DateTime::sub() cannot be called statically in /in/pCHYr:4 Stack trace: #0 {main} thrown in /in/pCHYr on line 4
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Warning: DateTime::sub() expects exactly 1 parameter, 2 given in /in/pCHYr on line 4 NULL
Output for 5.3.7 - 5.6.28
Fatal error: Non-static method DateTime::sub() cannot be called statically in /in/pCHYr on line 4
Process exited with code 255.