How does php implement non-blocking tasks?

problem description

I just want to simply use php to implement non-blocking tasks

  https://github.com/reactphp

what I want to implement is that there are some tasks in function,function in do. After careful consideration, it should not be possible to implement this operation, because the context of asynchronous tasks has changed. I wonder if my understanding is correct?


PHP itself is executed sequentially, and there is no use of asynchronous callbacks or what you call non-blocking usage.

if it is a CLI-based application, you can try to use swoole to implement it. Swoole is an extension of PHP that implements asynchronous non-blocking operations.


workerman learn about pure php.

add:
did not see the link you gave, just a simple idea, similar to the method of writing callback in nodejs;

  

by default, a single-threaded implementation cannot be implemented by
recompiling to turn on multithreaded mode.

Menu