3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $today = new DateTime(); $currentLocationTime = new DateTime( '2014-08-01 16:27:33' ); //formatting date time string to date $gap = date_diff( $today, $currentLocationTime )->days; echo $gap; ?>
based on lVSXc
Output for 5.3.0 - 5.4.32, 5.6.28, 7.0.14 - 7.1.0
31
Output for 7.0.6
640
Output for 7.0.5
610
Output for 7.0.4
586
Output for 7.0.3
595
Output for 7.0.2
599
Output for 7.0.1
600
Output for 7.0.0
603
Output for hhvm-3.12.0
589
Output for hhvm-3.10.0
607
Output for 5.6.21
639
Output for 5.6.20
617
Output for 5.6.19
584
Output for 5.6.18
591
Output for 5.6.17
596
Output for 5.6.16
604
Output for 5.6.15
605
Output for 5.6.14
609
Output for 5.6.13
622
Output for 5.6.12
627
Output for 5.6.11
630
Output for 5.6.10
632
Output for 5.6.9
635
Output for 5.6.8
637
Output for 5.5.35
659
Output for 5.5.34
618
Output for 5.5.33
585
Output for 5.5.32
593
Output for 5.5.31
597
Output for 5.5.30
608
Output for 5.5.29
624
Output for 5.5.28
628
Output for 5.5.27
629
Output for 5.5.26
633
Output for 5.5.25
636
Output for 5.5.24
661
Output for 5.4.45
399
Output for 5.4.39 - 5.4.44
379
Output for 5.4.34 - 5.4.38
215
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined function date_diff() in /in/3alGC on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/3alGC on line 2
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/3alGC on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/3alGC on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/3alGC on line 4
Process exited with code 255.