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

Latest version: pecl install openswoole-22.1.2 | composer require openswoole/core:22.1.5

Declaration

<?php OpenSwoole\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 OpenSwoole\Coroutine::getPcid();
});
Last updated on September 1, 2022