Well I confused by behavior of PHP when parsing a PHP file. I am reading this since long that
The PHP language is interpreted
So I have code
var_dump(function_exists('abc')); exit;
function abc() {
return;
}
var_dump should print false as per my assumption but it print bool(true).
Can somebody please help me to understand this behavior?
See this answer.
In short, it is compiled into a type of bytecode at runtime and then interpreted - in doing this, you will have the definitions for your functions available, even if they appear at the very end.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With