src/ConcurrentPhpUtils/CasThreadedMemberTrait.php
public function casMember($member, $oldValue, $newValue)
    {
        $set = false;

        $this->lock();
        if ($this[$member] == $oldValue) {
            $this[$member] = $newValue;

            $set = true;
        }
        $this->unlock();

        return $set;
    }
public function casMember($member, $oldValue, $newValue)
    {
        $set = false;

        $this->lock();
        if ($this[$member] == $oldValue) {
            $this[$member] = $newValue;

            $set = true;
        }
        $this->unlock();

        return $set;
    }
public function casMember ( $ member , $ oldValue , $ newValue ) { $ set = false ; $ this -> lock ( ) ; if ( $ this [ $ member ] == $ oldValue ) { $ this [ $ member ] = $ newValue ; $ set = true ; } $ this -> unlock ( ) ; return $ set ; }
Performs a compare and swap operation on a class member

@param string $member
@param mixed $oldValue
@param mixed $newValue
@return bool
Performs a compare and swap operation on a class member