SHARE
TWEET

Untitled

a guest Aug 20th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function my_max(array $values): int {
  2.     $max = $values[0];
  3.     foreach ($values as $currentVal) {
  4.         if ($max < $currentVal) {
  5.             $max = $currentVal;
  6.         }
  7.     }
  8.     return $max;
  9. }
  10.  
  11. echo my_max([1, 2, 3]);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top