1--TEST--
2swoole_timer: after fork
3--SKIPIF--
4<?php require __DIR__ . '/../include/skipif.inc'; ?>
5--FILE--
6<?php
7require __DIR__ . '/../include/bootstrap.php';
8$id = Swoole\Timer::after(1, function () { echo 'never here' . PHP_EOL; });
9if (Assert::greaterThan($id, 0)) {
10    $process = new Swoole\Process(function () use ($id) {
11        // timer will be removed before fork
12        Assert::false(Swoole\Timer::exists($id));
13        echo "DONE\n";
14    });
15    $process->start();
16    $process::wait();
17    Assert::true(Swoole\Timer::clear($id));
18}
19Swoole\Event::wait();
20?>
21--EXPECT--
22DONE
23