3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?hh class Foo { public function __construct(private int $x){} public function xPrinter() { return () ==> print $this->x; } } $bar = new Foo(42); $xPrinter = $bar->xPrinter(); $xPrinter();
Output for hhvm-3.10.0 - 3.12.0
42
Output for 5.3.0 - 5.4.32
<?hh class Foo { public function __construct(private int $x){} public function xPrinter() { return () ==> print $this->x; } } $bar = new Foo(42); $xPrinter = $bar->xPrinter(); $xPrinter();