3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $now = new DateTime(); $birthday = new DateTime('1973-04-18 09:48:00'); $interval = $now->diff($birthday); echo $interval->format('%a days');
Output for 5.6.28, 7.0.14 - 7.1.0
15456 days
Output for 7.0.6
15720 days
Output for 7.0.5
15690 days
Output for 7.0.4
15666 days
Output for 7.0.3
15674 days
Output for 7.0.2
15678 days
Output for 7.0.1
15680 days
Output for 7.0.0
15683 days
Output for hhvm-3.12.0
15667 days
Output for hhvm-3.10.0
15686 days
Output for 5.6.21
15719 days
Output for 5.6.20
15697 days
Output for 5.6.19
15663 days
Output for 5.6.18
15671 days
Output for 5.6.17
15675 days
Output for 5.6.16
15684 days
Output for 5.6.15
15685 days
Output for 5.6.14
15689 days
Output for 5.6.13
15702 days
Output for 5.6.12
15707 days
Output for 5.6.11
15710 days
Output for 5.6.10
15712 days
Output for 5.6.9
15714 days
Output for 5.6.8
15717 days
Output for 5.6.7
15742 days
Output for 5.5.35
15739 days
Output for 5.5.34
15698 days
Output for 5.5.33
15665 days
Output for 5.5.32
15673 days
Output for 5.5.31
15676 days
Output for 5.5.30
15688 days
Output for 5.5.29
15704 days
Output for 5.5.28
15708 days
Output for 5.5.27
15709 days
Output for 5.5.26
15713 days
Output for 5.5.25
15715 days
Output for 5.5.24
15718 days
Output for 5.3.0 - 5.4.45
15648 days
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::diff() in /in/I51Oh on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/I51Oh on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/I51Oh on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/I51Oh on line 2