Are php tics non-blocking

I accidentally stumbled upon things like:

<?php declare(ticks=1); // using a function as the callback register_tick_function('my_function', true); // using an object->method $object = new my_class(); register_tick_function(array(&$object, 'my_method'), true); ?> 

What can be found in register_tick_function .

I wanted to know if using this blocks in php?

EDIT: What do I mean by this, if I have more than one php tick run running in a single thread, is it able to process IO in the background while other ticks are running, or does it need to wait for each tick to give control?

+6
source share
1 answer

Tick ​​functions are blocked. PHP generally does not support (initially) parallel execution in the same request. No, you will not be able to handle IO in the background or anything like that.

Which ticks more or less insert tick function calls after each statement. So what you get is something like this:

 tick(); $a = 1; tick(); $b = 2; tick(); // ... 

And he will behave like that :)

Although this is how you understand whether this is really important: when the callback is executed in JS (for example, a timeout / event is fired), then it is also blocked.

+2
source

All Articles