主页
PHP
PHP 函数
tryphp_function_variadic2_error
运行 ❯
×
更改方向
保存代码
更改主题
<?php function myFamily(...$firstname, $lastname) { $txt = ""; $len = count($firstname); for($i = 0; $i < $len; $i++) { $txt = $txt."Hi, $firstname[$i] $lastname.
"; } return $txt; } $a = myFamily("Doe", "Jane", "John", "Joey"); echo $a; ?>
PHP 致命错误: 只有最后一个参数可以是可变参数,位于 /home/KfRGPk/prog.php 的第 6 行