Recall & Review
beginner
What happens to a PHP script during a single web request?
The PHP script is loaded, executed from start to finish, and then the process ends. Each request starts a new process or thread that runs the script independently.
Click to reveal answer
beginner
Why does PHP use a process model per request?
To keep each request isolated, so errors or data from one request do not affect others. This makes PHP simple and secure for web applications.
Click to reveal answer
beginner
How does PHP handle variables and memory between requests?
Variables and memory are created fresh for each request and destroyed when the request ends. PHP does not keep variables or memory between requests.
Click to reveal answer
intermediate
What is the role of the web server in PHP's process model?
The web server receives the request, starts a PHP process or thread to run the script, then sends the output back to the client after the script finishes.
Click to reveal answer
intermediate
How does PHP's process model affect performance?
Starting a new process for each request adds some overhead, but PHP uses techniques like opcode caching to speed up execution and reduce delays.
Click to reveal answer
What happens to PHP variables after a web request finishes?
✗ Incorrect
PHP variables exist only during the request and are destroyed afterward to keep requests isolated.
Which component starts the PHP process for each request?
✗ Incorrect
The web server receives the request and starts the PHP process to run the script.
Why does PHP create a new process for each request?
✗ Incorrect
Isolating requests prevents errors or data leaks between users.
What technique helps PHP reduce the overhead of starting a process each request?
✗ Incorrect
Opcode caching stores compiled code to speed up script execution.
In PHP's process model, when does the script execution end?
✗ Incorrect
Each script runs only during its request and ends when the request finishes.
Explain how PHP handles a web request from start to finish in its process model.
Think about what happens each time you load a PHP page in your browser.
You got /6 concepts.
Describe the advantages and disadvantages of PHP's process model per request.
Consider both how it helps and what challenges it creates.
You got /5 concepts.