3v4l.org

run code in 200+ 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.3.0rc4
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.17.3
Fatal error: Uncaught Error: Non-static method DateTime::sub() cannot be called statically in /in/pCHYr:4 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.1 - 3.15.4
Warning: DateTime::sub() expects exactly 1 parameter, 2 given in /in/pCHYr on line 4 NULL
Output for 5.3.0 - 5.6.30
Fatal error: Non-static method DateTime::sub() cannot be called statically in /in/pCHYr on line 4
Process exited with code 255.