Swoole\Coroutine::getCid ()

Notice: ext-swoole is supported until v4.7.1, use ext-openswoole >= v4.7.1. Latest version: pecl install openswoole-4.9.1

Declaration

<?php
Swoole\Coroutine::getCid ()

Parameters

Return

cid

Current coroutine ID.

Description

Get the current Coroutine ID.

Example

<?php
Co\run(function () {
    echo Swoole\Coroutine::getCid();
});