????:兩個整數(shù)相加的函數(shù):<?phpfunction add($a,$b){ return "$a + $b = ".($a + $b);}echo add(5,6);
兩個整數(shù)相加的函數(shù):
<?php
function add($a,$b){
return "$a + $b = ".($a + $b);
}
echo add(5,6);
?? ???:天蓬老師?? ??:2019-06-03 09:30:49
???? ??:在php 7+中, 支持類型限定
function add(int $a,$b) : int
{
return "$a + $b = ".($a + $b);
}