Created
July 11, 2015 01:48
-
-
Save anonymous/ae9e0f743c3dbeee24c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output:
HHVM version: