两个整数相加的函数

Original 2019-05-31 22:16:04 183
abstract:两个整数相加的函数:<?phpfunction add($a,$b){    return "$a + $b = ".($a + $b);}echo add(5,6);

两个整数相加的函数:

<?php
function add($a,$b){
   return "$a + $b = ".($a + $b);
}

echo add(5,6);

Correcting teacher:天蓬老师Correction time:2019-06-03 09:30:49
Teacher's summary:在php 7+中, 支持类型限定 function add(int $a,$b) : int { return "$a + $b = ".($a + $b); }

Release Notes

Popular Entries