3v4l.org

run code in 200+ php & hhvm versions
<?php declare(strict_types=1); function foo(string $message) { $message = 5; var_dump(gettype($message)); } foo('x');
based on LHr2f
Output for hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.2.6
string(7) "integer"
Output for 5.6.0 - 5.6.30
Warning: Unsupported declare 'strict_types' in /in/bjaLQ on line 2 Catchable fatal error: Argument 1 passed to foo() must be an instance of string, string given, called in /in/bjaLQ on line 9 and defined in /in/bjaLQ on line 4
Process exited with code 255.