3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class DateTimeFactory { const DATE_INTERVAL = 'PT20M'; public static createDateTimeByInterval(DateInterval $dateInterval) { // create DateTime, add Date and/or TimeZone if needed. $dateTime = new DateTime(); return $dateTime->add($dateInterval); } } var_dump(DateTimeFactory::createDateTimeByInterval(new DateInterval(DateTimeFactory::DATE_INTERVAL)));
Output for 5.4.0 - 5.4.24
Parse error: syntax error, unexpected 'createDateTimeByInterval' (T_STRING), expecting variable (T_VARIABLE) in /in/0lSGH on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/0lSGH on line 7
Process exited with code 255.