3v4l.org

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