public function emit($val, $key = null)
    {
        $this->_result[$key === null ? $this->_counter : $key] = $val;
        $this->_counter++;
    }
public function emit($val, $key = null)
    {
        $this->_result[$key === null ? $this->_counter : $key] = $val;
        $this->_counter++;
    }
public function emit ( $ val , $ key = null ) { $ this -> _result [ $ key === null ? $ this -> _counter : $ key ] = $ val ; $ this -> _counter ++ ; }
Appends a new record to the final list of results and optionally assign a key
for this record.

@param mixed $val The value to be appended to the final list of results
@param string|null $key and optional key to assign to the value
@return void
Appends a new record to the final list of results and optionally assign a key for this record .