3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php public function diffInDays(\DateTime $dateEnd, \DateTime $dateStart) { $interval = $dateEnd->diff($dateStart); return (int) $interval->format('%a'); } $startDate = new \DateTime('2015-11-09 21:00:00.000000', new \DateTimeZone('UTC')); $endDate = new \DateTime('2015-11-08 21:00:00.000000', new \DateTimeZone('UTC')); var_dump(diffInDays($startDate, $startDate));
Output for 7.0.0 - 7.0.1
Parse error: syntax error, unexpected 'public' (T_PUBLIC), expecting end of file in /in/a9del on line 3
Process exited with code 255.
Output for 5.4.11 - 5.6.16
Parse error: syntax error, unexpected 'public' (T_PUBLIC) in /in/a9del on line 3
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_PUBLIC in /in/a9del on line 3
Process exited with code 255.