-
-
Save jazzdan/26d64882fab4a3d95c1e 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: