3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date1 = new DateTime('2010-01-25'); $date2 = new DateTime('2010-02-20'); $interval = $date2->diff($date1); $months = ($interval->y * 12) + $interval->m; $months += number_format(interval->d / 30, 1); echo $months;
Output for 5.4.0 - 5.4.22
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /in/7WliZ on line 8
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/7WliZ on line 8
Process exited with code 255.