6
Example scenario:
echo hello();
echo '<br>';
echo 'Hello ' . world('World');
function hello() {
return 'World';
}
function world($v) {
return $v;
}
Exit:
World
Hello World
Like the PHP
process this?
On the example, we can conclude: the echo
is before the method, then the PHP does not read line by line in sequence, 'cause if it was that way, he wouldn’t have read the method below to be able to resolve the current line (which is before), correct!?
Doubts:
He’s been reading line by line and by positioning in a line that calls a method, it searches that method in every script and stores in memory, and only after back to solve where did you stop?
- Assuming this is the case, when he finishes searching for the method and solves the line in position, he continues reading the
script
following the next lines, so on?
- Assuming this is the case, when he finishes searching for the method and solves the line in position, he continues reading the
Very good your doubt, I will research, I was quite interested.
– Wees Smith