Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a pull request that I opened in my own fork to preview the diff and allow code review.
This PR adds a new "Loop" mode that can be used with
-L
. For example:php -L script.php
.This mode runs the script in a loop.
The big difference with doing a
while(true) {}
loop in PHP is that every execution of the script is isolated from the other executions.Use cases
php -L
each event/request would be processed in an isolated PHP environment without having the overhead of starting a new process (this is the main reason that motivated this work, I will publish more information about this soon)Maybe there are opportunities too for ReactPHP/Amp/Aerys/etc to benefit from that (provide very fast response times without having to sacrifice request isolation).
Example
Before:
With the "loop mode":