3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $disconnect = "2015-11-07"; $disco_date = date_create($disconnect); $date_fail = date_add($disco_date, date_interval_create_from_date_string("60 days")); $date_recorded = "2015-11-11 05:47:10"; if($date_fail > $date_recorded) { echo "date recorded = {$date_recorded} \n"; echo "date fail = {$date_fail['date']} \n"; echo "good to go"; } else echo "exception";
based on JcurS
Output for 7.0.0 - 7.2.0
date recorded = 2015-11-11 05:47:10 Fatal error: Uncaught Error: Cannot use object of type DateTime as array in /in/FSVjA:11 Stack trace: #0 {main} thrown in /in/FSVjA on line 11
Process exited with code 255.
Output for 5.3.19 - 5.6.28
date recorded = 2015-11-11 05:47:10 Fatal error: Cannot use object of type DateTime as array in /in/FSVjA on line 11
Process exited with code 255.