3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $row2['post_date'] = "2014-10-02 10:00:00"; $now = new DateTime(); $post = new DateTime($row2['post_date']); $interval = $now->diff($post); $hours = $interval->h + ($interval->format("%a") * 24 * 60); echo "Updated $hours hours ago";
based on 4S9uc
Output for 5.3.0 - 5.4.32, 5.6.28, 7.0.14 - 7.1.0
Updated 4 hours ago
Output for 7.0.6
Updated 832342 hours ago
Output for 7.0.5
Updated 789131 hours ago
Output for 7.0.4
Updated 754582 hours ago
Output for 7.0.3
Updated 766102 hours ago
Output for 7.0.2
Updated 773284 hours ago
Output for 7.0.1
Updated 774729 hours ago
Output for 7.0.0
Updated 779051 hours ago
Output for 5.6.21
Updated 830898 hours ago
Output for 5.6.20
Updated 799210 hours ago
Output for 5.6.19
Updated 751686 hours ago
Output for 5.6.18
Updated 761774 hours ago
Output for 5.6.17
Updated 768963 hours ago
Output for 5.6.16
Updated 780492 hours ago
Output for 5.6.15
Updated 781933 hours ago
Output for 5.6.14
Updated 787696 hours ago
Output for 5.6.13
Updated 806420 hours ago
Output for 5.6.12
Updated 813609 hours ago
Output for 5.6.11
Updated 817937 hours ago
Output for 5.6.10
Updated 820818 hours ago
Output for 5.6.9
Updated 823703 hours ago
Output for 5.6.8
Updated 828007 hours ago
Output for 5.6.7
Updated 865443 hours ago
Output for 5.5.35
Updated 859701 hours ago
Output for 5.5.34
Updated 800653 hours ago
Output for 5.5.33
Updated 753129 hours ago
Output for 5.5.32
Updated 764655 hours ago
Output for 5.5.31
Updated 770405 hours ago
Output for 5.5.30
Updated 786255 hours ago
Output for 5.5.29
Updated 809290 hours ago
Output for 5.5.28
Updated 815053 hours ago
Output for 5.5.27
Updated 816495 hours ago
Output for 5.5.26
Updated 822261 hours ago
Output for 5.5.25
Updated 826563 hours ago
Output for 5.5.24
Updated 862570 hours ago
Output for 5.4.39 - 5.4.45
Updated 509764 hours ago
Output for 5.4.34 - 5.4.38
Updated 236161 hours ago
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::diff() in /in/Gjjo5 on line 6
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/Gjjo5 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/Gjjo5 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/Gjjo5 on line 4