3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php define('SAISON_DURATION', 123); $diff = date_create('first day of January')->diff(new DateTime()); printf('saison %d, jour %d', $diff->days / SAISON_DURATION + 1, $diff->days % SAISON_DURATION);
Output for 5.3.0 - 7.1.0
saison 2, jour 17
Output for 5.2.6 - 5.2.17
Fatal error: Call to a member function diff() on a non-object in /in/6XE00 on line 4
Process exited with code 255.
Output for 5.2.0 - 5.2.5
Warning: date_create(): Failed to parse time string (first day of January) at position 10 (o): The timezone could not be found in the database in /in/6XE00 on line 4 Fatal error: Call to undefined method DateTime::diff() in /in/6XE00 on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function date_create() in /in/6XE00 on line 4
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/6XE00 on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/6XE00 on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/6XE00 on line 4
Process exited with code 255.