3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $now = new DateTime('yesterday'); $future_date = new DateTime('2017-07-17 8:00:00'); $interval = $future_date->diff($yesterday); echo $interval->format("%a days, %h hours, %i minutes, %s seconds");
based on O7B0D
Output for 7.3.0alpha1 - 7.3.0beta1
Notice: Undefined variable: yesterday in /in/ctbet on line 6 Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, null given in /in/ctbet on line 6 Fatal error: Uncaught Error: Call to a member function format() on bool in /in/ctbet:8 Stack trace: #0 {main} thrown in /in/ctbet on line 8
Process exited with code 255.
Output for 7.0.0 - 7.2.6
Notice: Undefined variable: yesterday in /in/ctbet on line 6 Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, null given in /in/ctbet on line 6 Fatal error: Uncaught Error: Call to a member function format() on boolean in /in/ctbet:8 Stack trace: #0 {main} thrown in /in/ctbet on line 8
Process exited with code 255.
Output for hhvm-3.15.4
Notice: Undefined variable: yesterday in /in/ctbet on line 6 Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, stdClass given in /in/ctbet on line 6 Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function format() on a non-object (boolean)' in /in/ctbet:8 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Notice: Undefined variable: yesterday in /in/ctbet on line 6 Warning: DateTime::diff() expects parameter 1 to be DateTimeInterface, null given in /in/ctbet on line 6 Fatal error: Call to a member function format() on boolean in /in/ctbet on line 8
Process exited with code 255.