3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $today = new DateTime("now"); $date_end = new DateTime('2016-12-15'); if($today < $date_end){ $interval = $today->diff($date_end); if(intval($interval) < 30){ echo $interval; } }
Output for 7.1.0 - 7.2.0
Notice: Object of class DateInterval could not be converted to int in /in/sqTqG on line 6 Recoverable fatal error: Object of class DateInterval could not be converted to string in /in/sqTqG on line 7
Process exited with code 255.
Output for 5.3.20 - 7.0.20
Notice: Object of class DateInterval could not be converted to int in /in/sqTqG on line 6 Catchable fatal error: Object of class DateInterval could not be converted to string in /in/sqTqG on line 7
Process exited with code 255.