Skip to content

Instantly share code, notes, and snippets.

@asm89
Created April 19, 2016 08:12
Show Gist options
  • Save asm89/57a81c17b5317a746c1f9074aa852f83 to your computer and use it in GitHub Desktop.
Save asm89/57a81c17b5317a746c1f9074aa852f83 to your computer and use it in GitHub Desktop.
<?hh
function f(?int $x): ?int {
if ($x === null) return $x;
else return $x * 2;
}
function x(): ?int {
return null;
}
function y(): ?string {
return null;
}
function main(): void {
f(x());
f(y());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment