3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date1 = new \DateTime(); $date2 = \DateTime::createFromFormat('Y-m-d', '2014-06-24'); var_dump($date2->diff($date1)->days);
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.28, 5.6.28, 7.0.14 - 7.1.0
int(33)
Output for 7.0.6
int(679)
Output for 5.6.14, 7.0.5
int(648)
Output for 7.0.4
int(625)
Output for 7.0.3
int(633)
Output for 7.0.2
int(637)
Output for 7.0.1
int(638)
Output for 7.0.0
int(641)
Output for 5.6.15, hhvm-3.12.0
int(643)
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.21
int(678)
Output for 5.6.20
int(655)
Output for 5.6.19
int(622)
Output for 5.6.18
int(629)
Output for 5.6.17
int(634)
Output for 5.6.16
int(642)
Output for 5.6.13
int(661)
Output for 5.6.12
int(665)
Output for 5.6.11
int(669)
Output for 5.6.10
int(671)
Output for 5.6.9
int(673)
Output for 5.6.8
int(675)
Output for 5.6.7
int(701)
Output for 5.5.35
int(698)
Output for 5.5.34
int(656)
Output for 5.5.33
int(623)
Output for 5.5.32
int(632)
Output for 5.5.31
int(635)
Output for 5.5.30
int(647)
Output for 5.5.29
int(662)
Output for 5.5.28
int(666)
Output for 5.5.27
int(668)
Output for 5.5.26
int(672)
Output for 5.5.25
int(674)
Output for 5.5.24
int(699)
Output for 5.4.45
int(442)
Output for 5.4.44
int(429)
Output for 5.4.43
int(382)
Output for 5.4.42
int(370)
Output for 5.4.38 - 5.4.41
int(351)
Output for 5.4.36 - 5.4.37
int(229)
Output for 5.4.34 - 5.4.35
int(163)
Output for 5.3.29, 5.4.29 - 5.4.32
int(74)
Output for 5.2.10 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/GEASg on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/GEASg on line 4 Fatal error: Call to undefined method DateTime::createFromFormat() in /in/GEASg on line 4
Process exited with code 255.
Output for 5.2.0 - 5.2.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/GEASg on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/GEASg on line 4 Fatal error: Call to undefined method DateTime::createfromformat() in /in/GEASg on line 4
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/GEASg on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/GEASg on line 4 Fatal error: Class 'DateTime' not found in /in/GEASg on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/GEASg on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/GEASg on line 4 Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/GEASg on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/GEASg on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/GEASg on line 4 Parse error: parse error, unexpected T_OBJECT_OPERATOR in /in/GEASg on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/GEASg on line 3 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/GEASg on line 4 Parse error: parse error in /in/GEASg on line 6
Process exited with code 255.