3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class X{ function f(Tp $p) { } } (new X())->f(1);
based on JMZo1
Output for 7.3.0alpha1 - 7.3.0rc4
Fatal error: Uncaught TypeError: Argument 1 passed to X::f() must be an instance of Tp, int given, called in /in/CKFYi on line 8 and defined in /in/CKFYi:4 Stack trace: #0 /in/CKFYi(8): X->f(1) #1 {main} thrown in /in/CKFYi on line 4
Process exited with code 255.
Output for 7.0.0 - 7.2.6
Fatal error: Uncaught TypeError: Argument 1 passed to X::f() must be an instance of Tp, integer given, called in /in/CKFYi on line 8 and defined in /in/CKFYi:4 Stack trace: #0 /in/CKFYi(8): X->f(1) #1 {main} thrown in /in/CKFYi on line 4
Process exited with code 255.
Output for 5.4.10 - 5.6.28
Catchable fatal error: Argument 1 passed to X::f() must be an instance of Tp, integer given, called in /in/CKFYi on line 8 and defined in /in/CKFYi on line 4
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/CKFYi on line 8
Process exited with code 255.