WordPress at a glance
function is not described

WP_Object_Cache::decr() WP 3.3.0

Decrements numeric cache item's value.

This is a method of the class: WP_Object_Cache

No Hooks.

Return

false/Int. False on failure, the item's new value on success.

Usage

$WP_Object_Cache = new WP_Object_Cache();
$var = $WP_Object_Cache->decr( $key, $offset, $group );
$key(int/string) (required)
The cache key to decrement.
$offset(int)
The amount by which to decrement the item's value.
Default: 1
$group(string)
The group the key is in.
Default: 'default'

Changelog

Since 3.3.0 Introduced.

Code of WP Object Cache::decr: wp-includes/cache.php WP 5.2.2

<?php
public function decr( $key, $offset = 1, $group = 'default' ) {
	if ( empty( $group ) ) {
		$group = 'default';
	}

	if ( $this->multisite && ! isset( $this->global_groups[ $group ] ) ) {
		$key = $this->blog_prefix . $key;
	}

	if ( ! $this->_exists( $key, $group ) ) {
		return false;
	}

	if ( ! is_numeric( $this->cache[ $group ][ $key ] ) ) {
		$this->cache[ $group ][ $key ] = 0;
	}

	$offset = (int) $offset;

	$this->cache[ $group ][ $key ] -= $offset;

	if ( $this->cache[ $group ][ $key ] < 0 ) {
		$this->cache[ $group ][ $key ] = 0;
	}

	return $this->cache[ $group ][ $key ];
}