3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function hasDeadlinePast($event_id) { $event_date = '2014-06-04'; $event_date = new DateTime($event_date); $today = new DateTime('today'); // $days = $event_date->diff($today)->d; $days = $event_date->diff($today)->format('%R%a days'); echo $days; if ($days >= 14) { //return $days . ' days left' . "\n"; } //return 'registration has past'; } echo hasDeadlinePast(NULL);
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.29, 5.6.28, 7.0.14 - 7.1.0
+16 days
Output for 7.0.6
+699 days
Output for 7.0.5
+669 days
Output for 7.0.4
+645 days
Output for 7.0.3
+653 days
Output for 7.0.2
+658 days
Output for 7.0.1
+659 days
Output for 7.0.0
+662 days
Output for hhvm-3.12.0
+648 days
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.21
+698 days
Output for 5.6.20
+676 days
Output for 5.6.19
+643 days
Output for 5.6.18
+650 days
Output for 5.6.17
+655 days
Output for 5.6.16
+663 days
Output for 5.6.15
+664 days
Output for 5.6.14
+668 days
Output for 5.6.13
+681 days
Output for 5.6.12
+686 days
Output for 5.6.11
+690 days
Output for 5.6.10
+691 days
Output for 5.6.9
+693 days
Output for 5.6.8
+696 days
Output for 5.5.35
+718 days
Output for 5.5.34
+677 days
Output for 5.5.33
+644 days
Output for 5.5.32
+652 days
Output for 5.5.31
+656 days
Output for 5.5.30
+667 days
Output for 5.5.29
+683 days
Output for 5.5.28
+687 days
Output for 5.5.27
+688 days
Output for 5.5.26
+692 days
Output for 5.5.25
+695 days
Output for 5.5.24
+720 days
Output for 5.4.44 - 5.4.45
+468 days
Output for 5.4.39 - 5.4.43
+417 days
Output for 5.4.34 - 5.4.38
+273 days
Output for 5.3.29, 5.4.30 - 5.4.32
+101 days
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::diff() in /in/8ch46 on line 9
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/8ch46 on line 6
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/8ch46 on line 9
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/8ch46 on line 9
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/8ch46 on line 9
Process exited with code 255.