3v4l.org

run code in 200+ php & hhvm versions
<?php declare(strict_types=1); declare(fixed_types=1); var $x = 7; function foo(string $message) { $message = 5; var_dump(gettype($message)); } foo('x');
based on 3NB9K
Output for 7.0.0 - 7.2.0
Parse error: syntax error, unexpected 'var' (T_VAR), expecting end of file in /in/o0PFg on line 5
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught Error: syntax error, unexpected T_VAR, expecting $end in /in/o0PFg:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught Error: syntax error, unexpected T_VAR, expecting $end in /in/o0PFg:5 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Warning: Unsupported declare 'strict_types' in /in/o0PFg on line 2 Warning: Unsupported declare 'fixed_types' in /in/o0PFg on line 3 Parse error: syntax error, unexpected 'var' (T_VAR) in /in/o0PFg on line 5
Process exited with code 255.