3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?hh type Point<T> = shape ('x' => T, 'y' => T); function demo1(Point<T> $pt1){} // do stufff - general case type Point<int> = shape ('x' => int, 'y' => int); function demo2(Point<int> $pt1) {} // special case for Point of type int only type Point<int> = shape ('x' => 0, 'y' => 0); function demo3(Point<int> $pt1) {} // special case for Point of type int where y is 0
Output for 5.3.0 - 5.4.32
<?hh type Point<T> = shape ('x' => T, 'y' => T); function demo1(Point<T> $pt1){} // do stufff - general case type Point<int> = shape ('x' => int, 'y' => int); function demo2(Point<int> $pt1) {} // special case for Point of type int only type Point<int> = shape ('x' => 0, 'y' => 0); function demo3(Point<int> $pt1) {} // special case for Point of type int where y is 0