两个整数相加的函数

Original 2019-03-12 23:10:59 347
abstract:<?php function test(int $a,int $b){     $sum=$a+$b;     return $sum; } echo test(11,12); ?>以上代码实现了两个整数相加的基本函数结构,首先声明了一个函数体名为test,
<?php
function test(int $a,int $b){
    $sum=$a+$b;
    return $sum;
}
echo test(11,12);
?>

以上代码实现了两个整数相加的基本函数结构,首先声明了一个函数体名为test,并赋予了两个变量和其数据类型,然后封装了一个加法运算的函数运算,然后通过给这个函数体赋值,成功输出了两个数的和

Correcting teacher:查无此人Correction time:2019-03-13 09:17:30
Teacher's summary:完成的不错。函数名尽量起个有意义的。继续加油,少年

Release Notes

Popular Entries