fork download
  1.  
  2. <?php
  3. $datetime1 = date('Y-m-d');
  4.  
  5. $datetime2 = date_create('2009-10-13');
  6. $interval = date_diff($datetime1, $datetime2);
  7. echo $interval->format('%a');
  8. ?>
  9.  
Runtime error #stdin #stdout #stderr 0.01s 83904KB
stdin
Standard input is empty
stdout

	
stderr
PHP Warning:  date_diff() expects parameter 1 to be DateTimeInterface, string given in /home/4tgDo1/prog.php on line 6
PHP Fatal error:  Uncaught Error: Call to a member function format() on boolean in /home/4tgDo1/prog.php:7
Stack trace:
#0 {main}
  thrown in /home/4tgDo1/prog.php on line 7