OpenSwoole\Coroutine::exists

25.x is outdated, please check the latest version 26.x


Latest version: pecl install openswoole-26.2.0

Declaration

<?php OpenSwoole\Coroutine::exists(int $cid): bool

Parameters

cid

coroutine ID.

Return

exists

if success, it returns TRUE, otherwise it returns FALSE.

Description

Check if a coroutine is exists by coroutine ID.

Example

<?php
co::run(function () {
  echo OpenSwoole\Coroutine::exists(OpenSwoole\Coroutine::getCid());
});
Last updated on February 28, 2026