3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = "2014-09-29"; $today = date(); $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 KQ9PM
Output for 5.1.2 - 7.1.0
Warning: date() expects at least 1 parameter, 0 given in /in/eZJgr on line 3 Notice: Undefined variable: years in /in/eZJgr on line 7 Notice: Undefined variable: months in /in/eZJgr on line 7 16341
Output for 5.1.0 - 5.1.1
Warning: date() expects at least 1 parameter, 0 given in /in/eZJgr on line 3 Notice: Undefined variable: years in /in/eZJgr on line 7 Notice: Undefined variable: months in /in/eZJgr on line 7 2
Output for 5.0.4 - 5.0.5
Warning: Wrong parameter count for date() in /in/eZJgr on line 3 Warning: strtotime(): Called with an empty time parameter. in /in/eZJgr on line 5 Notice: Undefined variable: years in /in/eZJgr on line 7 Notice: Undefined variable: months in /in/eZJgr on line 7 16341
Output for 5.0.1 - 5.0.3
Warning: Wrong parameter count for date() in /in/eZJgr on line 3 Warning: strtotime(): Called with an empty time parameter. in /in/eZJgr on line 5 Notice: Undefined variable: years in /in/eZJgr on line 7 Notice: Undefined variable: months in /in/eZJgr on line 7 16341
Output for 4.3.2 - 5.0.0
Warning: Wrong parameter count for date() in /in/eZJgr on line 3 Notice: strtotime(): Called with empty time parameter in /in/eZJgr on line 5 Notice: Undefined variable: years in /in/eZJgr on line 7 Notice: Undefined variable: months in /in/eZJgr on line 7 3
Output for 4.3.0 - 4.3.1
Warning: Wrong parameter count for date() in /in/eZJgr on line 3 Notice: strtotime() [http://www.php.net/function.strtotime]: Called with empty time parameter in /in/eZJgr on line 5 Notice: Undefined variable: years in /in/eZJgr on line 7 Notice: Undefined variable: months in /in/eZJgr on line 7 3