3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date1 = date_create(date('d-m-Y',strtotime('2014-06-27'))); $date2 = date_create(date('d-m-Y',strtotime('2014-07-30'))); $dat1 = strtotime('2014-06-27'); $dat2 = strtotime('2014-07-30'); echo floor(($dat2 - $dat1)/3600/24) print_r(date_diff($date2, $date1));
Output for 5.4.0 - 5.4.29
Parse error: syntax error, unexpected 'print_r' (T_STRING), expecting ',' or ';' in /in/L2BWq on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /in/L2BWq on line 7
Process exited with code 255.

preferences:
177.3 ms | 1395 KiB | 66 Q