PHP program to create a function to find the addition of two integer numbers
<?php
//function definition
//this function will take two integer arguments
//and return the sum of them
function addTwoNumbers(int $x, int $y)
{
return $x + $y;
}
//calling the function and printing the result
echo " sum of 10 and 25 : " . addTwoNumbers(10, 25);
echo "<br>";
echo " sum of 30 and -10: " . addTwoNumbers(30, -10);
echo "<br>";
?>
Output
sum of 10 and 25 : 35
sum of 30 and -10: 20
