3v4l.org

run code in 300+ PHP versions simultaneously
<?php function returns_null(): void { return null; // Fatal error: A void function must not return a value } function returns_null(): void { return ; // Fatal error: A void function must not return a value } try { returns_null(); echo "OK!"; } catch (Error $e) { echo "Error:"; var_dump($e); }
Output for 7.0.0 - 7.0.2
Fatal error: Cannot redeclare returns_null() (previously declared in /in/TDagO:4) in /in/TDagO on line 9
Process exited with code 255.
Output for 5.5.24 - 5.5.31, 5.6.8 - 5.6.17
Parse error: syntax error, unexpected ':', expecting '{' in /in/TDagO on line 3
Process exited with code 255.

preferences:
172.52 ms | 1387 KiB | 28 Q