3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = "2014-09-29"; $today = date('Y-m-d'); $diff = abs(strtotime($date) - strtotime($today)); $days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24)); echo $days;
based on eZJgr
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined variable: years in /in/9CKWP on line 7 Notice: Undefined variable: months in /in/9CKWP on line 7 3
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: years in /in/9CKWP on line 7 Notice: Undefined variable: months in /in/9CKWP on line 7 3