3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $start = (new \DateTime('02 Feb 2014 14:34')); $now = (new \DateTime()); $length = (new \DateTimeInterval('1y')); var_dump(['start' => $start, 'now' => $now, 'length' => $length]);
based on 7HI2a
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Class 'DateTimeInterval' not found in /in/DdAT2:5 Stack trace: #0 {main} thrown in /in/DdAT2 on line 5
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Fatal error: Class 'DateTimeInterval' not found in /in/DdAT2 on line 5
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/DdAT2 on line 7
Process exited with code 255.