OpenSwoole\Coroutine::getCid ()

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


Latest version: pecl install openswoole-26.2.0

Declaration

<?php OpenSwoole\Coroutine::getCid ()

Parameters

Return

cid

Current coroutine ID.

Description

Get the current Coroutine ID.

Example

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