2 seconds elapsed
is called every second, is launched after 2 seconds
iteration = 1
is called every second, is launched after 2 seconds
iteration = 2
is called every second, is launched after 2 seconds
iteration = 3
is called every second, is launched after 2 seconds
iteration = 4
is called every second, is launched after 2 seconds
iteration = 5
Run single iteration
Callback of a timer created as stopped
Restart the second watcher and try to handle the same events, but don't block
Running a blocking loop
is called every second, is launched after 2 seconds
iteration = 8
is called every second, is launched after 2 seconds
iteration = 9
is called every second, is launched after 2 seconds
iteration = 10
END

<?php/** Try to get an embeddable event loop and embed it into the default event loop.* If it is impossible, use the default* loop. The default loop is stored in $loop_hi, while the embeddable loop is* stored in $loop_lo(which is $loop_hi in the case no embeddable loop can be* used).** Sample translated to PHP* http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#Examples_CONTENT-9*/$loop_hi = EvLoop::defaultLoop();$loop_lo = NULL;$embed = NULL;

/** See if there is a chance of getting one that works* (flags' value of 0 means autodetection)*/$loop_lo = Ev::embeddableBackends() & Ev::recommendedBackends() ? new EvLoop(Ev::embeddableBackends() & Ev::recommendedBackends()) : 0;

Exemplo #8 Embedding loop created with kqueue backend into the default loop

<?php/** Check if kqueue is available but not recommended and create a kqueue backend* for use with sockets (which usually work with any kqueue implementation).* Store the kqueue/socket-only event loop in loop_socket. (One might optionally* use EVFLAG_NOENV, too)** Example borrowed from* http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#Examples_CONTENT-9*/$loop = EvLoop::defaultLoop();$socket_loop = NULL;$embed = NULL;