Jump to content

Recommended Posts

1: Is Zend informed when a PHP file is updated or does it check the file every time someone accesses it?

2: What happens to scripts that are already running if their source PHP file is updated?

3: What happens to scripts that include another php file, and then the included file's source php gets updated? Can the script "re-include" that file again while running?
Link to comment
https://forums.phpfreaks.com/topic/7376-quick-questions/
Share on other sites

[!--quoteo(post=364667:date=Apr 13 2006, 11:27 PM:name=jworisek)--][div class=\'quotetop\']QUOTE(jworisek @ Apr 13 2006, 11:27 PM) [snapback]364667[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Are you sure you understand how php works?

PHP is processed server side. Data is only sent to the browser after processing or until you break off from the php script.

Your script is not processing indefinitely. Everytime a script runs it loads all the includes called for it.
[/quote]

I know the scripts don't run indefinately. They do what they do and then they stop. I'm just curious how the engine checks if a source file was updated, and how this effects scripts already running that were based on those source files.

if I have a file test.php and it has
<? php echo "one" ?>
when I go to it ill just see 1 on my browser window

If I update the file to be
<? php echo "two" ?>
and I go to it i should see 2 on my browser window, but sometimes this change takes a few seconds to happen.

I wanna know how PHP handles these updates.
Link to comment
https://forums.phpfreaks.com/topic/7376-quick-questions/#findComment-26847
Share on other sites

PHP isn't compiled code, so it doesn't need to check for updates. Files will run regardless of their last updates, the Processor doesn't care about updates.

The update taking a few seconds could just be your cache loading the file. You should do a CTRL+Refresh when you update the files as it'll grab the latest copy of the file from the server.

C
Link to comment
https://forums.phpfreaks.com/topic/7376-quick-questions/#findComment-26853
Share on other sites

thanks, you've been of great help

I just have one more question, a bit of an odd scenario.

Say file A includes another file B
Then file A spaws some object from a class file B provided
Then file A alters file B (actually edits it on the HD)
Then file A includes file B yet again... is this allowed, or will it cause some error?
Link to comment
https://forums.phpfreaks.com/topic/7376-quick-questions/#findComment-26861
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.