3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new \DateTime('-4 month', new \DateTimeZone('GMT')); //echo $date->format('m-d-Y'); $quarter = ceil($date->format('n') / 3); $year = $date->format('Y'); $month = $quarter * 3 + 1; $date = \DateTime::createFromFormat('Y-n-j H:i', strval($year+1)."-$month-1 00:00"); echo $date->format('d-m-Y H:i') . "\n"; echo date('d-m-Y H:i', $date->getTimestamp()) . "\n"; echo (new \DateTime('@'.$date->getTimestamp()->format('d-m-Y H:i');
based on 3fNFc
Output for 7.0.0 - 7.0.2
Parse error: syntax error, unexpected ';', expecting ',' or ')' in /in/Ke4IM on line 13
Process exited with code 255.
Output for 5.3.22 - 5.6.17
Parse error: syntax error, unexpected ';' in /in/Ke4IM on line 13
Process exited with code 255.