PHP Function Call Placement

后端 未结 5 586
孤独总比滥情好
孤独总比滥情好 2020-12-17 21:08

Consider this snippet:

function f() {
    return \'hi\';
}

echo f();

Vs this snippet:

echo f();

function f() {
    return         


        
5条回答
  •  囚心锁ツ
    2020-12-17 21:22

    No matter where you define your function and where you call. Because as far as I know, PHP server application first reads the whole page then executes it.

提交回复
热议问题