3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class JhDateTime extends DateTime {} $date1 = new JhDateTime("10 September 2014"); $date2 = new JhDateTime("17 September 2014"); $period = new \DatePeriod( $date1 , new \DateInterval("P1M"), $date2 ); foreach($period as $date) { var_dump(get_class($date)); }
Output for 5.5.24 - 7.1.0
string(10) "JhDateTime"
Output for 5.3.0 - 5.4.45
string(8) "DateTime"
Output for 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/DQShV on line 11 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/DQShV on line 13 Fatal error: Class 'DatePeriod' not found in /in/DQShV on line 11
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/DQShV on line 11 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/DQShV on line 13 Fatal error: Class 'DateTime' not found in /in/DQShV on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/DQShV on line 11 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/DQShV on line 13 Fatal error: Class jhdatetime: Cannot inherit from undefined class datetime in /in/DQShV on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/DQShV on line 11 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/DQShV on line 13 Fatal error: Class jhdatetime: Cannot inherit from undefined class datetime in /in/DQShV on line 4