I've been needing some insight as to how PHP scripts are handled after they are "compiled" and so forth.
Here is a prolonged scenario... mostly how I understand PHP to currently work, or I should say the code behind the scenes that makes PHP work.
Let Access(name.php) mean someone from the web has accessed the file in the brackets
Let [#] represent an instance of the script
Let Finish[#] mean the script finaly finished running
Let Update(name.php) mean that script was changed somehow
Let - represent a statement to describe the scenario
Let * represent an action
Let ? represent a question I have
== The Scenario ==
- We just uploaded a PHP file called "snes.php"
- This is the first time snes.php is accessed, so it will get compiled by the zend engine, then it should be in memory.
- This time snes.php is already in memory, so it starts to do what it has to do quicker.
? Is Zend informed when a file is updated or does it check the file every time someone accesses it
- Due to requests user  made, snes.php will run a loop that may take a few seconds to complete.
- I make snes.php include another file called "kid.php"
- The zend engine recognizes snes.php was altered, so it recompiles it.
- The zend engine also compiles kid.php because it is included by snes.php.
- a few seconds pass
? What happens to instance  that ran during this time? would it just live out it's course? or is the process somehow interrupted.
- user has made some requests that make snes.php run for a few seconds.
- We made snes.php smart, so it knows if kid.php has been updated, and it can decide to re-include kid.php
? is "re-including" even possible?
? what happens to class objects that already existed and became available from an older include
? will PHP recompile kid.php again for instance  of snes.php, or just use what's in memory from before
== Thanks ==
No replies to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users