OpenSwoole\Atomic\Long->cmpset

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


Latest version: pecl install openswoole-26.2.0

Declaration

<?php OpenSwoole\Atomic\Long->cmpset ( int $cmp = 0, int $new = 0 )

Parameters

cmp

The old value to compare with.

new

The new value

Return

Description

Compare and set the value of the atomic object. See more about Compare and set.

Example

Last updated on February 28, 2026