3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class util { public static function test(): string { return \DateTime::createFromFormat("Y-m-d H:i:s",time())->format("Y-m-d H:i:s"); } } echo util::test();
based on C2OqK
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to a member function format() on boolean in /in/fSAcl:7 Stack trace: #0 /in/fSAcl(11): util::test() #1 {main} thrown in /in/fSAcl on line 7
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/fSAcl on line 5
Process exited with code 255.