3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d = new \DateTime('6 month'); $d->->setTime(23, 59, 59); var_dump($d->format('c'));
Output for 5.6.0 - 5.6.27, 7.0.0 - 7.0.12
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /in/eRU7L on line 4
Process exited with code 255.

preferences:
181.63 ms | 1387 KiB | 48 Q