22-stop-uncaught.php 438 B

1234567891011121314151617
  1. <?php
  2. use React\EventLoop\Loop;
  3. // autoload for local project development or project installed as dependency for reactphp/reactphp
  4. (@include __DIR__ . '/../../vendor/autoload.php') || require __DIR__ . '/../../../../autoload.php';
  5. Loop::addTimer(10.0, function () {
  6. echo 'never';
  7. });
  8. set_exception_handler(function (Exception $e) {
  9. echo 'Uncaught error occured' . PHP_EOL;
  10. Loop::stop();
  11. });
  12. throw new RuntimeException();