3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); namespace websharks; class test{ public function hello(int $string): string { return (string)$string; } } echo (new test())->hello(1);
based on BnDkC
Output for 7.0.0 - 7.2.0
1
Output for 5.3.18 - 5.6.21
Warning: Unsupported declare 'strict_types' in /in/XF0dR on line 3 Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/XF0dR on line 7
Process exited with code 255.