Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Swoole\Atomic::addSwoole\Atomic::__construct>
^Swoole\AtomicLast updated: Mon, 26 Oct 2026

Swoole\Atomic::cmpset

(PECL swoole >= 1.9.0)

Swoole\Atomic::cmpset — Compare and set the value of the atomic object.

Description

public function Swoole\Atomic::cmpset(int $cmp_value, int $new_value): int

Parameters

cmp_value

The value to compare with the current value of the atomic object.

new_value

The value to set to the atomic object if the cmp_value is the same as the current value of the atomic object.

Return Values

The new value of the atomic object.


<Swoole\Atomic::addSwoole\Atomic::__construct>
^Swoole\AtomicLast updated: Mon, 26 Oct 2026