3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php ini_set('date.timezone', 'Europe/Copenhagen'); use \; $nowTime = new \DateTime; $programTime = new \DateTime(date('Y-m-d') . " 18:30"); $lengthSeconds = 1200; $endDate = $programTime->add(new \DateInterval('PT' . $lengthSeconds . 'S')); $diff = $endDate->diff($nowTime); var_dump($diff->getTimestamp());
Output for 5.4.0 - 5.4.31
Parse error: syntax error, unexpected ';', expecting identifier (T_STRING) in /in/bpkDX on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected ';', expecting T_STRING in /in/bpkDX on line 5
Process exited with code 255.