I have a php script that I'm running from command line (e.g php test.php &). I would like to know if the execution is "flushed" automatically when I change some values in the script (using vim) while the script is running or if the script is somehow "cached" in the php engine when it starts running.
2 Answers
include ($file) is included in time of execution.
If you have code for example
$i = 0;
while (true) {
include('subprog.php');
sleep(10);
$i++;
}
and change subprog.php beetwen iteration, next iteration will use new subprog.php content.
2 Comments
bumperbox
I don't think that will work, including the same file twice will just cause clashes with function and class names, etc
Martin MaKr Kratochvíl
You have to deal with it, beware of function in this periodicaly included piece of code and other duplicated definition .. Dynamicaly included subprog is not good idea, but could solve sometimes thinks directly and easily.