Swoole\Coroutine::getPcid(int $cid = 0)

4.x is outdated, please check the latest version 22.x


Latest version: pecl install openswoole-22.1.2

Declaration

<?php Swoole\Coroutine::getPcid(int $cid = 0)

Parameters

cid

Coroutine ID. By default, getting the parent coroutine ID of the current coroutine.

Return

cid

Coroutine ID.

Description

Get the parent coroutine ID of a coroutine by coroutine ID.

Example

<?php
Co\run(function () {
    echo Swoole\Coroutine::getPcid();
});
Last updated on August 31, 2022