3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<? class TypeHinter { public function giveMeAnInt(int $i) { var_dump($i); } } $th = new TypeHinter; $i = 5; $th->giveMeAnInt($i);
based on 6LmRo
Output for 7.0.0 - 7.1.0
int(5)
Output for hhvm-3.10.0 - 3.12.0
Catchable fatal error: Argument 1 passed to TypeHinter::giveMeAnInt() must be an instance of int, int given in /in/lrVMl on line 5
Process exited with code 255.
Output for 5.4.34 - 5.6.28
Catchable fatal error: Argument 1 passed to TypeHinter::giveMeAnInt() must be an instance of int, integer given, called in /in/lrVMl on line 10 and defined in /in/lrVMl on line 3
Process exited with code 255.
Output for 4.3.0 - 5.4.32
<? class TypeHinter { public function giveMeAnInt(int $i) { var_dump($i); } } $th = new TypeHinter; $i = 5; $th->giveMeAnInt($i);