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'); $newExpDate = $datetime2->format('Y'); for($i=0;$i<$interval->format('%Y.%d');$i++){ echo $newExpDate++; }
Output for 5.3.7 - 5.3.28, 5.4.0 - 5.4.26, 5.6.28, 7.0.14 - 7.1.0
05.12200820092010201120122013
Output for 5.6.14, 7.0.6
07.2020082009201020112012201320142015
Output for 7.0.5
07.2120082009201020112012201320142015
Output for 7.0.4
07.2620082009201020112012201320142015
Output for 7.0.3
07.520082009201020112012201320142015
Output for 5.5.27, 5.5.35, 7.0.2
07.920082009201020112012201320142015
Output for 5.5.24, 7.0.1
07.1120082009201020112012201320142015
Output for 5.6.9, 7.0.0
07.1420082009201020112012201320142015
Output for 5.6.20, hhvm-3.12.0
07.2820082009201020112012201320142015
Output for hhvm-3.10.0
07.1720082009201020112012201320142015
Output for 5.5.30, 5.6.21
07.1920082009201020112012201320142015
Output for 5.6.19
07.2320082009201020112012201320142015
Output for 5.6.13, 5.6.18
07.220082009201020112012201320142015
Output for 5.6.17
07.620082009201020112012201320142015
Output for 5.5.25, 5.6.16
07.1520082009201020112012201320142015
Output for 5.6.8, 5.6.15
07.1620082009201020112012201320142015
Output for 5.5.31, 5.6.12
07.720082009201020112012201320142015
Output for 5.6.11
07.1020082009201020112012201320142015
Output for 5.6.10
07.1220082009201020112012201320142015
Output for 5.5.34
07.2920082009201020112012201320142015
Output for 5.5.33
07.2520082009201020112012201320142015
Output for 5.5.29, 5.5.32
07.420082009201020112012201320142015
Output for 5.5.28
07.820082009201020112012201320142015
Output for 5.4.44 - 5.4.45, 5.5.26
07.1320082009201020112012201320142015
Output for 5.4.41 - 5.4.43
06.292008200920102011201220132014
Output for 5.4.39 - 5.4.40
06.22008200920102011201220132014
Output for 5.4.38
06.172008200920102011201220132014
Output for 5.4.34 - 5.4.37
06.262008200920102011201220132014
Output for 5.3.29, 5.4.27 - 5.4.32
05.26200820092010201120122013