3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { use B; } trait B { protected $foo = false; public function getFoo() : bool { return $this->foo; } } $a = new A(); var_dump($a->getFoo());
based on dce7E
Output for hhvm-3.15.4, 7.0.0 - 7.2.8
bool(false)
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/6DYCQ on line 10
Process exited with code 255.