fork download
  1. <?php
  2.  
  3. $next_bill_date = new DateTime(); if ($plan_interval_unit == 'year') { $interval_spec = 'P'.$plan['plan_interval_length'].'Y'; } else if ($plan_interval_unit == 'month') { $interval_spec = 'P'.$plan['plan_interval_length'].'M'; }
  4. echo $next_bill_date->add(new DateInterval($interval_spec));
Runtime error #stdin #stdout #stderr 0.03s 23744KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Notice:  Undefined variable: plan_interval_unit in /home/Bso1kb/prog.php on line 3
PHP Notice:  Undefined variable: plan_interval_unit in /home/Bso1kb/prog.php on line 3
PHP Notice:  Undefined variable: interval_spec in /home/Bso1kb/prog.php on line 4
PHP Fatal error:  Uncaught Exception: DateInterval::__construct(): Unknown or bad format () in /home/Bso1kb/prog.php:4
Stack trace:
#0 /home/Bso1kb/prog.php(4): DateInterval->__construct('')
#1 {main}
  thrown in /home/Bso1kb/prog.php on line 4