This site is mobile accessible. Press the "Tap Here" button to use a different font-size.


Smartphone icons created by Freepik - Flaticon

PHP Functions

Returning values

5 + 10 = 15
7 + 13 = 20
2 + 4 = 6

<?php
// create function sum()
function sum(int $x, int $y) {
  $z = $x + $y;
  return $z; // return $z
}

echo "5 + 10 = " . sum(5,10) . "<br>";
echo "7 + 13 = " . sum(7,13) . "<br>";
echo "2 + 4 = " . sum(2,4);
?>