3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $datetime1 = new DateTime(); $datetime2 = new DateTime('2008-9-13'); $interval = $datetime2->diff($datetime1); echo $interval->format('%Y.%d'); for($i=0;$i<$interval->format('%Y.%d');$i++){ //$newExpDate ++; $cnt=$i+1; $newExpDate = $exp_date->add("$cnt years"); echo " ".$newExpDate; }
Output for 7.0.14 - 7.1.0
05.12 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Uncaught Error: Call to a member function add() on null in /in/hku2e:11 Stack trace: #0 {main} thrown in /in/hku2e on line 11
Process exited with code 255.
Output for 7.0.6
07.20 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Uncaught Error: Call to a member function add() on null in /in/hku2e:11 Stack trace: #0 {main} thrown in /in/hku2e on line 11
Process exited with code 255.
Output for 7.0.5
07.21 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Uncaught Error: Call to a member function add() on null in /in/hku2e:11 Stack trace: #0 {main} thrown in /in/hku2e on line 11
Process exited with code 255.
Output for 7.0.4
07.26 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Uncaught Error: Call to a member function add() on unknown in /in/hku2e:11 Stack trace: #0 {main} thrown in /in/hku2e on line 11
Process exited with code 255.
Output for 7.0.3
07.5 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Uncaught Error: Call to a member function add() on unknown in /in/hku2e:11 Stack trace: #0 {main} thrown in /in/hku2e on line 11
Process exited with code 255.
Output for 7.0.2
07.9 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Uncaught Error: Call to a member function add() on unknown in /in/hku2e:11 Stack trace: #0 {main} thrown in /in/hku2e on line 11
Process exited with code 255.
Output for 7.0.1
07.11 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Uncaught Error: Call to a member function add() on unknown in /in/hku2e:11 Stack trace: #0 {main} thrown in /in/hku2e on line 11
Process exited with code 255.
Output for 7.0.0
07.14 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Uncaught Error: Call to a member function add() on unknown in /in/hku2e:11 Stack trace: #0 {main} thrown in /in/hku2e on line 11
Process exited with code 255.
Output for 5.6.28
05.12 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on null in /in/hku2e on line 11
Process exited with code 255.
Output for 5.6.21
07.19 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on null in /in/hku2e on line 11
Process exited with code 255.
Output for 5.6.20
07.28 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on null in /in/hku2e on line 11
Process exited with code 255.
Output for 5.6.19
07.23 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on null in /in/hku2e on line 11
Process exited with code 255.
Output for 5.6.13, 5.6.18
07.2 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on null in /in/hku2e on line 11
Process exited with code 255.
Output for 5.6.17
07.6 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on null in /in/hku2e on line 11
Process exited with code 255.
Output for 5.6.16
07.15 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on null in /in/hku2e on line 11
Process exited with code 255.
Output for 5.6.8, 5.6.15
07.16 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on null in /in/hku2e on line 11
Process exited with code 255.
Output for 5.6.14
07.20 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on null in /in/hku2e on line 11
Process exited with code 255.
Output for 5.6.12
07.7 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on null in /in/hku2e on line 11
Process exited with code 255.
Output for 5.6.11
07.10 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on null in /in/hku2e on line 11
Process exited with code 255.
Output for 5.6.10
07.12 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on null in /in/hku2e on line 11
Process exited with code 255.
Output for 5.6.9
07.14 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on null in /in/hku2e on line 11
Process exited with code 255.
Output for 5.5.27, 5.5.35
07.9 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on a non-object in /in/hku2e on line 11
Process exited with code 255.
Output for 5.5.34
07.29 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on a non-object in /in/hku2e on line 11
Process exited with code 255.
Output for 5.5.33
07.25 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on a non-object in /in/hku2e on line 11
Process exited with code 255.
Output for 5.5.29, 5.5.32
07.4 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on a non-object in /in/hku2e on line 11
Process exited with code 255.
Output for 5.5.31
07.7 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on a non-object in /in/hku2e on line 11
Process exited with code 255.
Output for 5.5.30
07.19 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on a non-object in /in/hku2e on line 11
Process exited with code 255.
Output for 5.5.28
07.8 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on a non-object in /in/hku2e on line 11
Process exited with code 255.
Output for 5.4.44 - 5.4.45, 5.5.26
07.13 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on a non-object in /in/hku2e on line 11
Process exited with code 255.
Output for 5.5.25
07.15 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on a non-object in /in/hku2e on line 11
Process exited with code 255.
Output for 5.5.24
07.11 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on a non-object in /in/hku2e on line 11
Process exited with code 255.
Output for 5.4.41 - 5.4.43
06.29 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on a non-object in /in/hku2e on line 11
Process exited with code 255.
Output for 5.4.39 - 5.4.40
06.2 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on a non-object in /in/hku2e on line 11
Process exited with code 255.
Output for 5.4.38
06.17 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on a non-object in /in/hku2e on line 11
Process exited with code 255.
Output for 5.4.34 - 5.4.37
06.26 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on a non-object in /in/hku2e on line 11
Process exited with code 255.
Output for 5.3.29, 5.4.27 - 5.4.32
05.26 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on a non-object in /in/hku2e on line 11
Process exited with code 255.
Output for 5.3.7 - 5.3.28, 5.4.0 - 5.4.26
05.12 Notice: Undefined variable: exp_date in /in/hku2e on line 11 Fatal error: Call to a member function add() on a non-object in /in/hku2e on line 11
Process exited with code 255.