diff --git a/solutions/031.md b/solutions/031.md index 829e2a6..8e055e3 100644 --- a/solutions/031.md +++ b/solutions/031.md @@ -63,4 +63,23 @@ class Solution: return result ``` +#### PHP + +```php +class Solution { + + /** + * @param Integer $n + * @param Integer $start + * @return Integer + */ + function xorOperation($n, $start) { + $result = $start; + for($i = 1; $i < $n; $i++){ + $result = $result ^ ($start + 2* $i); + } + return $result; + } +} +``` ***NB***: If you want to get community points please suggest solutions in other languages as merge requests.