3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $seconds = 90773; $interval = DateInterval::createFromDateString("3600 seconds"); $now = new DateTimeImmutable(); $new = $now->add($interval); var_dump($now->diff($new)->format('d'));
based on hPvf0
Output for 5.5.24 - 7.2.0
string(1) "d"
Output for 5.3.0 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/ngkiB on line 5
Process exited with code 255.
Output for 5.0.0 - 5.2.17
Fatal error: Class 'DateInterval' not found in /in/ngkiB 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/ngkiB on line 7
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/ngkiB on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/ngkiB on line 7
Process exited with code 255.