3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php date_default_timezone_set('America/New_York'); $dtLastUpdate = DateTime::createFromFormat('Ymd', '20140704'); $dtLastUpdate->format('Ymd'); $now = new DateTime(); $now->format('Ymd'); $dDiff = $dtLastUpdate->diff($now); echo $dDiff->days;
Output for 5.6.28, 7.0.14 - 7.1.0
1
Output for 7.0.6
669
Output for 7.0.5
638
Output for 7.0.4
615
Output for 7.0.3
623
Output for 7.0.2
627
Output for 7.0.1
628
Output for 7.0.0
631
Output for 5.6.21
667
Output for 5.6.20
645
Output for 5.6.19
612
Output for 5.6.18
619
Output for 5.6.17
624
Output for 5.6.16
632
Output for 5.6.15
633
Output for 5.6.14
637
Output for 5.6.13
650
Output for 5.6.12
655
Output for 5.6.11
658
Output for 5.6.10
660
Output for 5.6.9
663
Output for 5.6.8
665
Output for 5.6.7
691
Output for 5.5.35
688
Output for 5.5.34
646
Output for 5.5.33
613
Output for 5.5.32
621
Output for 5.5.31
625
Output for 5.5.30
636
Output for 5.5.29
652
Output for 5.5.28
656
Output for 5.5.27
657
Output for 5.5.26
661
Output for 5.5.25
664
Output for 5.5.24
689
Output for 5.3.0 - 5.4.45
465
Output for 5.2.10 - 5.2.17
Fatal error: Call to undefined method DateTime::createFromFormat() in /in/Z2M2Z on line 4
Process exited with code 255.
Output for 5.2.0 - 5.2.9
Fatal error: Call to undefined method DateTime::createfromformat() in /in/Z2M2Z on line 4
Process exited with code 255.
Output for 5.1.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/Z2M2Z on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function date_default_timezone_set() in /in/Z2M2Z on line 3
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_default_timezone_set() in /in/Z2M2Z on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: date_default_timezone_set() in /in/Z2M2Z on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_default_timezone_set() in /in/Z2M2Z on line 3