3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function is_fastbonus($reg_date){ $reg_date = $reg_date->format('Y-m-d'); $expire = date('Y-m-d', strtotime($reg_date.' + 60 days')); $diff = strtotime($expire) - strtotime(date('Y-m-d')); $daysleft = floor( $diff / (60 * 60 * 24) ); if($daysleft > 0) return $daysleft; else return FALSE; } echo is_fastbonus('2014-04-01');
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to a member function format() on string in /in/vlrNb:4 Stack trace: #0 /in/vlrNb(14): is_fastbonus('2014-04-01') #1 {main} thrown in /in/vlrNb on line 4
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function format() on a non-object (string)' in /in/vlrNb:4 Stack trace: #0 /in/vlrNb(14): is_fastbonus() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.28
Fatal error: Call to a member function format() on string in /in/vlrNb on line 4
Process exited with code 255.
Output for 5.0.0 - 5.5.37
Fatal error: Call to a member function format() on a non-object in /in/vlrNb on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Call to a member function on a non-object in /in/vlrNb on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to a member function on a non-object in /in/vlrNb on line 4