Consider this snippet:
function f() { return \'hi\'; } echo f();
Vs this snippet:
echo f(); function f() { return
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.