3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $end_date = new DateTime('2014-07-11 14:00:00'); $begin_date = new DateTime('2014-07-11 09:15:00'); echo "begin_date is " . $begin_date->format('Y-m-d H:i:s') . " and end_date is " . $end_date->format('Y-m-d H:i:s') . "<br>"; $diff = $end_date->diff($begin_date); $hour_diff = $diff->h; $minute_diff = $diff->i; $diff_in_hours = $hour_diff + $minute_diff / 60 echo "The difference is " . . " hours and " . $diff->i . " minutes, which is " . $diff_in_hours . "hours<br>";
based on 8nVjn
Output for 5.4.0 - 5.4.34
Parse error: syntax error, unexpected 'echo' (T_ECHO) in /in/FlEjL on line 14
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_ECHO in /in/FlEjL on line 14
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_ECHO in /in/FlEjL on line 14
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/FlEjL on line 14
Process exited with code 255.