亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Internal function of php custom function

Internal function means that a function is declared inside the function.

Notes:

1. The internal function name cannot be an existing function name

2. Assume that an internal function is defined in function a, You cannot use function a twice.

Let’s look at the code below, you will learn it quickly:

<?php
function foo()
{
   echo '我是函數(shù)foo喲,調一下我才會執(zhí)行定義函數(shù)bar的過程<br />';
 function bar()
 {
      echo '在foo函數(shù)內(nèi)部有個函數(shù)叫bar函數(shù)<br />';
 }


}

//現(xiàn)在還不能調用bar()函數(shù),因為它還不存在
bar();

foo();

//現(xiàn)在可以調用bar()函數(shù)了,因為foo()函數(shù)的執(zhí)行使得bar()函數(shù)變?yōu)橐讯x的函數(shù)

bar();

//再調一次foo()看看是不是會報錯?
foo();

?>

You will find that a bar function is defined inside the foo() function above, which is the inner function number .

After careful observation and experimentation, you will draw the following conclusions:

1. Calling foo() twice will report an error

2. If you do not adjust the foo() function The bar function cannot be executed because bar is inside foo

Continuing Learning
||
<?php function foo() { echo '我是函數(shù)foo喲,調一下我才會執(zhí)行定義函數(shù)bar的過程<br />'; function bar() { echo '在foo函數(shù)內(nèi)部有個函數(shù)叫bar函數(shù)<br />'; } } //現(xiàn)在還不能調用bar()函數(shù),因為它還不存在 bar(); foo(); //現(xiàn)在可以調用bar()函數(shù)了,因為foo()函數(shù)的執(zhí)行使得bar()函數(shù)變?yōu)橐讯x的函數(shù) bar(); //再調一次foo()看看是不是會報錯? foo(); ?>
submitReset Code