3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $d = new DateTime(); $diff_date = $d->diff( new DateTime('2014-02-09') )->days; echo $diff_date;
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.24, 5.6.28, 7.0.14 - 7.1.0
4
Output for 7.0.6
814
Output for 7.0.5
783
Output for 7.0.4
760
Output for 7.0.3
768
Output for 7.0.2
771
Output for 7.0.1
773
Output for 7.0.0
776
Output for hhvm-3.12.0
761
Output for hhvm-3.10.0
779
Output for 5.6.21
812
Output for 5.6.20
790
Output for 5.6.19
756
Output for 5.6.18
764
Output for 5.6.17
769
Output for 5.6.16
777
Output for 5.6.15
778
Output for 5.6.14
782
Output for 5.6.13
795
Output for 5.6.12
800
Output for 5.6.11
803
Output for 5.6.10
805
Output for 5.6.9
808
Output for 5.6.8
810
Output for 5.6.7
835
Output for 5.5.35
833
Output for 5.5.34
791
Output for 5.5.33
758
Output for 5.5.32
766
Output for 5.5.31
770
Output for 5.5.30
781
Output for 5.5.29
797
Output for 5.5.28
801
Output for 5.5.27
802
Output for 5.5.26
806
Output for 5.5.25
809
Output for 5.5.24
811
Output for 5.4.45
581
Output for 5.4.41 - 5.4.44
552
Output for 5.4.39 - 5.4.40
453
Output for 5.4.38
386
Output for 5.4.36 - 5.4.37
364
Output for 5.4.34 - 5.4.35
298
Output for 5.3.29, 5.4.25 - 5.4.32
209
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::diff() in /in/BIPU4 on line 3
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/BIPU4 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/BIPU4 on line 3
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/BIPU4 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/BIPU4 on line 3
Process exited with code 255.