【請教】在函數里面定義函數后,調用,為什么會報錯?
<?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
2017-03-26
重復定義了test6函數了
把var_dump(test5())去掉即可
調用了test5后 可以直接調用test6
2017-10-21
函數不能嵌套
2017-07-24
不太清楚