lib/blobfolio/common/data.php
public static function array_pop_rand(array &$arr) {
		$length = \count($arr);

		if (! $length) {
			return false;
		}

		// Nothing random about an array with one thing.
		if (1 === $length) {
			return static::array_pop_top($arr);
		}

		$keys = \array_keys($arr);
		$index = static::random_int(0, $length - 1);

		return $arr[$keys[$index]];
	}
public static function array_pop_rand(array &$arr) {
		$length = \count($arr);

		if (! $length) {
			return false;
		}

		// Nothing random about an array with one thing.
		if (1 === $length) {
			return static::array_pop_top($arr);
		}

		$keys = \array_keys($arr);
		$index = static::random_int(0, $length - 1);

		return $arr[$keys[$index]];
	}
public static function array_pop_rand ( array & $ arr ) { $ length = \ count ( $ arr ) ; if ( ! $ length ) { return false ; } // Nothing random about an array with one thing. if ( 1 === $ length ) { return static :: array_pop_top ( $ arr ) ; } $ keys = \ array_keys ( $ arr ) ; $ index = static :: random_int ( 0 , $ length - 1 ) ; return $ arr [ $ keys [ $ index ] ] ; }
Return a random array element.

@param array $arr Array.
@return mixed Value. False on error.
Return a random array element .