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