3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $row2['post_date'] = "2014-10-01 10:00:00"; $now = new DateTime(); $post = new DateTime($row2['post_date']); $interval = $now->diff($post); $hours = $interval->h + ($interval->format("%a") * 24); echo "Updated $hours hours ago";
based on ilItU
Output for 5.3.0 - 5.4.32, 5.6.28, 7.0.14 - 7.1.0
Updated 19 hours ago
Output for 7.0.6
Updated 13913 hours ago
Output for 7.0.5
Updated 13182 hours ago
Output for 7.0.4
Updated 12616 hours ago
Output for 7.0.3
Updated 12808 hours ago
Output for 7.0.2
Updated 12891 hours ago
Output for 7.0.1
Updated 12939 hours ago
Output for 7.0.0
Updated 13013 hours ago
Output for hhvm-3.12.0
Updated 12646 hours ago
Output for hhvm-3.10.0
Updated 13091 hours ago
Output for 5.6.21
Updated 13884 hours ago
Output for 5.6.20
Updated 13345 hours ago
Output for 5.6.19
Updated 12543 hours ago
Output for 5.6.18
Updated 12722 hours ago
Output for 5.6.17
Updated 12837 hours ago
Output for 5.6.16
Updated 13039 hours ago
Output for 5.6.15
Updated 13064 hours ago
Output for 5.6.14
Updated 13162 hours ago
Output for 5.6.13
Updated 13478 hours ago
Output for 5.6.12
Updated 13587 hours ago
Output for 5.6.11
Updated 13667 hours ago
Output for 5.6.10
Updated 13716 hours ago
Output for 5.6.9
Updated 13770 hours ago
Output for 5.6.8
Updated 13825 hours ago
Output for 5.6.7
Updated 14437 hours ago
Output for 5.5.35
Updated 14367 hours ago
Output for 5.5.34
Updated 13375 hours ago
Output for 5.5.33
Updated 12579 hours ago
Output for 5.5.32
Updated 12776 hours ago
Output for 5.5.31
Updated 12839 hours ago
Output for 5.5.30
Updated 13138 hours ago
Output for 5.5.29
Updated 13516 hours ago
Output for 5.5.28
Updated 13615 hours ago
Output for 5.5.27
Updated 13641 hours ago
Output for 5.5.26
Updated 13743 hours ago
Output for 5.5.25
Updated 13797 hours ago
Output for 5.5.24
Updated 13852 hours ago
Output for 5.4.39 - 5.4.45
Updated 8524 hours ago
Output for 5.4.34 - 5.4.38
Updated 3961 hours ago
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::diff() in /in/4S9uc on line 6
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/4S9uc on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/4S9uc on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/4S9uc on line 4