3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function f(bool $b) { var_dump($b); } f(1); f(0); f((bool) null);
based on oG8mb
Output for hhvm-3.15.4, 7.0.0 - 7.2.6
bool(true) bool(false) bool(false)
Output for 5.6.0 - 5.6.30
Catchable fatal error: Argument 1 passed to f() must be an instance of bool, integer given, called in /in/u2PAp on line 5 and defined in /in/u2PAp on line 3
Process exited with code 255.