3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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); }
based on h0tn2
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.3.22 - 5.6.17
Parse error: syntax error, unexpected ':', expecting '{' in /in/TDagO on line 3
Process exited with code 255.