<?php function foo() { echo '我是函数foo哟,调一下我才会执行定义函数bar的过程<br />'; function bar() { echo '在foo函数内部有个函数叫bar函数<br />'; } } //现在还不能调用bar()函数,因为它还不存在 //bar(); foo(); //现在可以调用bar()函数了,因为foo()函数的执行使得bar()函数变为已定义的函数 bar(); //再调一次foo()看看是不是会报错? foo(); ?>
问题产生原因:
多次引用导致的重复声明
代码来源:http://www.php.cn/code/1094.html