Say I have file.php with three functions and an echo statement:
function one() {
return three() . ' This is one.';
}
function two() {
return 'This is two.';
}
function three() {
return 'This is three.';
}
echo one(); // string(xx) "This is three. This is one."
First, is it generally acceptable to have function one() call function three() even though function three() appears later in the file?
Second, when file.php is loaded in the browser (thus executing the PHP on the server), does PHP calculate the return value of function two(), even though it is never called?
Any links for further reading on how PHP process mundane things like this would be great.