3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date_actuel = new \DateTime(); $date_concours = new \DateTime('2013-05-15'); $diff = $date_actuel->diff($date_concours); $jours = $diff->days; echo $jours;
Output for 5.6.28, 7.0.14 - 7.3.0rc4
28
Output for 7.0.6
1084
Output for 7.0.5
1054
Output for 7.0.4
1030
Output for 7.0.3
1038
Output for 7.0.2
1043
Output for 7.0.1
1044
Output for 7.0.0
1047
Output for 5.6.21
1083
Output for 5.6.20
1061
Output for 5.6.19
1028
Output for 5.6.18
1035
Output for 5.6.17
1039
Output for 5.6.16
1048
Output for 5.6.15
1049
Output for 5.6.14
1053
Output for 5.6.13
1066
Output for 5.6.12
1071
Output for 5.6.11
1075
Output for 5.6.10
1076
Output for 5.6.9
1078
Output for 5.6.8
1081
Output for 5.5.35
1103
Output for 5.5.34
1062
Output for 5.5.33
1029
Output for 5.5.32
1037
Output for 5.5.31
1041
Output for 5.5.30
1052
Output for 5.5.29
1068
Output for 5.5.28
1072
Output for 5.5.27
1073
Output for 5.5.26
1077
Output for 5.5.25
1079
Output for 5.5.24
1105
Output for 5.3.0 - 5.4.45
1009
Output for 5.2.0 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/13Ke1 on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/13Ke1 on line 3 Fatal error: Call to undefined method DateTime::diff() in /in/13Ke1 on line 5
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/13Ke1 on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/13Ke1 on line 3 Fatal error: Class 'DateTime' not found in /in/13Ke1 on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/13Ke1 on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/13Ke1 on line 3 Fatal error: Cannot instantiate non-existent class: datetime in /in/13Ke1 on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/13Ke1 on line 2 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/13Ke1 on line 3 Fatal error: Cannot instantiate non-existent class: datetime in /in/13Ke1 on line 2