苹果coding
2017-03-26 00:07
<?php
function test5(){
function test6(){
echo 'this is test6';
return 888;
}
echo 123;
return test6();
}
test5();
echo '<hr />';
var_dump(test5());上面这段代码报错:
Fatal error: Cannot redeclare test6() (previously declared in E:\xampp\htdocs\test\testecho.php:4) in E:\xampp\htdocs\test\testecho.php on line 4

重复定义了test6函数了
把var_dump(test5())去掉即可
调用了test5后 可以直接调用test6
函数不能嵌套
不太清楚
PHP进阶篇-函数
23924 学习 · 51 问题
相似问题