Is there some guide out there that describes how the PHP internals?
PHP is an interpreted language. This means that you will write code statements (lines of code) and when a page is requested, the PHP interpreter will load your PHP code, parse it and then execute it. This differs from other languages, such as Java or C#, where the source code is compiled and then executed.
In PHP, statements are terminated by a semicolon (;) like C or Perl. The closing tag of a block of PHP code automatically implies a semicolon, there is no need to have a semicolon terminating the last line of a PHP block.
The closure is a function assigned to a variable, so you can pass it around. A closure is a separate namespace, normally, you can not access variables defined outside of this namespace. There comes the use keyword: use allows you to access (use) the succeeding variables inside the closure.
A closure is an anonymous function that can access variables imported from the outside scope without using any global variables. Theoretically, a closure is a function with some arguments closed (e.g. fixed) by the environment when it is defined. Closures can work around variable scope restrictions in a clean way.
Sounds to me like you're you should look for resources on PHP Internal development. Looking for this information elsewhere will be really scattered.
I suggest picking up a PHP Core development book from your local book store and giving it a read. PHP.net has an underdeveloped beginners reference if you wanted to start there.
This excellent although somewhat outdated book by Sara Golemon has answers to the most of your questions. Otherwise, the best way to learn php internals is to compile a debug version of it and run it step by step under a debugger. I did it once and it was an exciting experience.
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