src/JmesPath/TreeCompiler.php
private function makeVar($prefix)
    {
        if (!isset($this->vars[$prefix])) {
            $this->vars[$prefix] = 0;
            return '$' . $prefix;
        }

        return '$' . $prefix . ++$this->vars[$prefix];
    }
private function makeVar($prefix)
    {
        if (!isset($this->vars[$prefix])) {
            $this->vars[$prefix] = 0;
            return '$' . $prefix;
        }

        return '$' . $prefix . ++$this->vars[$prefix];
    }
Creates a monotonically incrementing unique variable name by prefix.

@param string $prefix Variable name prefix

@return string