3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?hh class Duplicator { private function transform($value) { return $value * 2; } public function getTransformed($stuff) { return $stuff->map($x ==> $x * 2); } } $duplicator = new Duplicator(); $stuff = Vector {1,2,3}; var_dump($duplicator->getTransformed($stuff));
based on C24hl
Output for hhvm-3.10.0 - 3.12.0
object(HH\Vector)#4 (3) { [0]=> int(2) [1]=> int(4) [2]=> int(6) }
Output for 5.4.0 - 5.4.32
<?hh class Duplicator { private function transform($value) { return $value * 2; } public function getTransformed($stuff) { return $stuff->map($x ==> $x * 2); } } $duplicator = new Duplicator(); $stuff = Vector {1,2,3}; var_dump($duplicator->getTransformed($stuff));