3v4l.org

run code in 300+ PHP versions simultaneously
<?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();
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.6
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.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/fSAcl on line 5
Process exited with code 255.

preferences:
120.73 ms | 402 KiB | 133 Q