1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<?php require __DIR__ . '/../vendor/autoload.php'; $loop = React\EventLoop\Factory::create(); $loop->addTimer(0.8, function () { echo 'world!' . PHP_EOL; }); $loop->addTimer(0.3, function () { echo 'hello '; }); $loop->run();