3v4l.org

run code in 300+ PHP versions simultaneously
<?php $end_date = new DateTime(date("Y-m-d H:i:s", strtotime("14:00"))); $begin_date = ; //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(new DateTime(date("Y-m-d H:i:s", strtotime("09:15")))); $diff_in_hours = $diff->h + $diff->i / 60; echo "The difference is " . $diff->h . " hours and " . $diff->i . " minutes, which is " . $diff_in_hours . " hours<br>";
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.34
Parse error: syntax error, unexpected ';' in /in/ikk5S on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected ';' in /in/ikk5S on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/ikk5S on line 4
Process exited with code 255.

preferences:
214.04 ms | 1395 KiB | 124 Q