Skip to content

Instantly share code, notes, and snippets.

Created July 11, 2015 01:48
Show Gist options
  • Save anonymous/ae9e0f743c3dbeee24c1 to your computer and use it in GitHub Desktop.
Save anonymous/ae9e0f743c3dbeee24c1 to your computer and use it in GitHub Desktop.
<?hh
class Wrapper<Tval as num> {
private Tval $value;
public function __construct(Tval $value) {
$this->value = $value;
}
public function setValue(Tval $value): void {
$this->value = $value;
}
public function getValue(): Tval {
return $this->value;
}
public function add(num $addend): void {
$this->value += $addend;
}
}
@Orvid
Copy link

Orvid commented Jul 11, 2015

http://3v4l.org/Wr33k <- Claims it works in previous versions...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment