Skip to content

Instantly share code, notes, and snippets.

@BenGriffiths
Created March 22, 2014 17:47
Show Gist options
  • Save BenGriffiths/9711397 to your computer and use it in GitHub Desktop.
Save BenGriffiths/9711397 to your computer and use it in GitHub Desktop.
Hack - Type Annotations Example
<?hh
class AnnotatedClass
{
public int $x;
private string $s;
protected array $arr;
public AnotherClass $ac;
function bar(string $str, bool $b): float
{
if ($b and $str === "Hi")
{
return 3.2;
}
return 0.3;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment