3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d1 = new DateTime(); $d2 = (new DateTime($d1->format('Y-m-d')))->modify('+1 day'); $diff $d1->format('N') - $d2->format('N'); echo $d2->format('Y-m-d'); $d2->add(new DateInterval('P1D'));
Output for 5.5.0 - 5.5.36, 5.6.0 - 5.6.22, 7.0.0 - 7.0.7
Parse error: syntax error, unexpected '$d1' (T_VARIABLE) in /in/hOFgB on line 6
Process exited with code 255.

preferences:
199.12 ms | 1395 KiB | 74 Q