Created
May 4, 2014 19:51
-
-
Save mageekguy/a5cf869ff2e79c1a4222 to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
class number | |
{ | |
private $value = 0; | |
public function addNumber(number $number) | |
{ | |
return $number->add($this->value); | |
} | |
public function add($value) | |
{ | |
return new self($this->value + $value); // Is it east oriented? Seems that only void, self and boolean are ok as return value… | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment