Creates an instance of a Counter which maintains a single numeric value.

Counter
Counter::getValue
Counter
PHP Manual

# Counter::__construct

Counter::__construct — Creates an instance of a Counter which maintains a single numeric value.

### Description

Counter::__construct ( string `$name` [, integer `$initial_value` [, integer `$flags` ]] )

Creates an instance of a Counter which maintains a single numeric value.

### Parameters

name
  The new counter's name.
initial_value
  The initial value of the counter. Defaults to zero (0).
flags
  Flags for the new counter, chosen from the COUNTER_FLAG_* constants.

### Return Values

Returns a Counter object on success.

### Errors/Exceptions

Counter::__construct() throws an Exception if something goes wrong.

Counter
Counter::getValue
Counter
PHP Manual