3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $now = new DateTime(); $birthday = new DateTime('1967-10-21 09:48:00'); $interval = $now->diff($birthday); echo $interval->format('%a days');
Output for 5.6.28, 7.0.12 - 7.2.0
16558 days
Output for 7.0.6
17745 days
Output for 5.6.14, 7.0.5
17708 days
Output for 7.0.4
17673 days
Output for 7.0.3
17681 days
Output for 7.0.2
17685 days
Output for 7.0.1
17687 days
Output for 7.0.0
17690 days
Output for 5.6.21
17726 days
Output for 5.6.20
17704 days
Output for 5.6.19
17670 days
Output for 5.6.18
17678 days
Output for 5.6.17
17682 days
Output for 5.6.16
17691 days
Output for 5.6.15
17692 days
Output for 5.6.13
17709 days
Output for 5.6.12
17714 days
Output for 5.6.11
17718 days
Output for 5.6.10
17719 days
Output for 5.6.9
17721 days
Output for 5.6.8
17723 days
Output for 5.5.35
17746 days
Output for 5.5.34
17705 days
Output for 5.5.33
17672 days
Output for 5.5.32
17680 days
Output for 5.5.31
17683 days
Output for 5.5.30
17695 days
Output for 5.5.29
17711 days
Output for 5.5.28
17715 days
Output for 5.5.27
17716 days
Output for 5.5.26
17720 days
Output for 5.5.25
17722 days
Output for 5.5.24
17748 days
Output for 5.3.0 - 5.4.45
17653 days
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::diff() in /in/FkuMV on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/FkuMV 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/FkuMV 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/FkuMV on line 2