<commit_before>--TEST--
swoole_server: addProcess with swoole_timer_tick fatal error
--SKIPIF--
<?php require __DIR__ . '/../include/skipif.inc'; ?>
--FILE--
<?php
require __DIR__ . '/../include/bootstrap.php';
$atomic = new Swoole\Atomic;
$pm = new ProcessManager;
$pm->parentFunc = function () use ($pm) {
    $pm->kill();
    echo "DONE\n";
};
$pm->childFunc = function () use ($pm) {

    class Process extends Swoole\Process
    {
        public function __construct()
        {
            parent::__construct([$this, 'run']);
        }

        public function run()
        {
			swoole_timer_tick(100, function () {
				global $atomic;
				if ($atomic->add() > 5) {
					global $pm;
					$pm->wakeup();
                    Co::yield();
                    return;
				}
				echo "sleep start then ";
				Co::sleep(0.01);
				echo "sleep end\n";
				trigger_error('ERROR', E_USER_ERROR);
			});
        }
    }

    $server = new Swoole\Server('127.0.0.1', get_one_free_port(), SWOOLE_PROCESS, SWOOLE_SOCK_UDP);
    $server->set(['log_file' => '/dev/null']);
    $server->on('packet', function () { });
    $server->addProcess(new Process);
    $server->start();
};
$pm->childFirst();
$pm->run();
?>
--EXPECTF--
sleep start then sleep end

Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_tick.php on line %d
sleep start then sleep end

Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_tick.php on line %d
sleep start then sleep end

Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_tick.php on line %d
sleep start then sleep end

Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_tick.php on line %d<commit_msg>Delete tabs<commit_after>--TEST--
swoole_server: addProcess with swoole_timer_tick fatal error
--SKIPIF--
<?php require __DIR__ . '/../include/skipif.inc'; ?>
--FILE--
<?php
require __DIR__ . '/../include/bootstrap.php';
$atomic = new Swoole\Atomic;
$pm = new ProcessManager;
$pm->parentFunc = function () use ($pm) {
    $pm->kill();
    echo "DONE\n";
};
$pm->childFunc = function () use ($pm) {

    class Process extends Swoole\Process
    {
        public function __construct()
        {
            parent::__construct([$this, 'run']);
        }

        public function run()
        {
            swoole_timer_tick(100, function () {
                global $atomic;
                if ($atomic->add() > 5) {
                    global $pm;
                    $pm->wakeup();
                    Co::yield();
                    return;
                }
                echo "sleep start then ";
                Co::sleep(0.01);
                echo "sleep end\n";
                trigger_error('ERROR', E_USER_ERROR);
            });
        }
    }

    $server = new Swoole\Server('127.0.0.1', get_one_free_port(), SWOOLE_PROCESS, SWOOLE_SOCK_UDP);
    $server->set(['log_file' => '/dev/null']);
    $server->on('packet', function () { });
    $server->addProcess(new Process);
    $server->start();
};
$pm->childFirst();
$pm->run();
?>
--EXPECTF--
sleep start then sleep end

Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_tick.php on line %d
sleep start then sleep end

Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_tick.php on line %d
sleep start then sleep end

Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_tick.php on line %d
sleep start then sleep end

Fatal error: ERROR in %s/tests/swoole_server/addProcess_with_tick.php on line %d
{'fraction_non_alphanumeric': 0.15077989601386482, 'fraction_numerical': 0.007510109763142692, 'mean_word_length': 2.5121703853955375, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4617960', 'n_tokens_mistral': 1190, 'n_tokens_neox': 1117, 'n_words': 272}