public function addValue($value, $q = 1.0)
	{
		$val = $this->parseValue($value);
		$q = floatval($q);
		
		if($q > 1)
		{
			$q = 1.0;
		}
		
		if($q < 0)
		{
			$q = 0.0;
		}
		
		// Ensure an existing element with the same value is removed.
		foreach($this->values as $index => $tmp)
		{
			if($tmp[self::KEY_VAL] == $val)
			{
				array_splice($this->values, $index, 1);
				
				break;
			}
		}
		
		// Insert new value at position denoted by q value.
		foreach($this->values as $index => $tmp)
		{
			if($tmp[self::KEY_Q] < $q)
			{
				array_splice($this->values, $index, 0, [[self::KEY_VAL => $val, self::KEY_Q => $q]]);
				
				return;
			}
		}
		
		// Append remainder
		$this->values[] = [self::KEY_VAL => $val, self::KEY_Q => $q];
	}
public function addValue($value, $q = 1.0)
	{
		$val = $this->parseValue($value);
		$q = floatval($q);
		
		if($q > 1)
		{
			$q = 1.0;
		}
		
		if($q < 0)
		{
			$q = 0.0;
		}
		
		// Ensure an existing element with the same value is removed.
		foreach($this->values as $index => $tmp)
		{
			if($tmp[self::KEY_VAL] == $val)
			{
				array_splice($this->values, $index, 1);
				
				break;
			}
		}
		
		// Insert new value at position denoted by q value.
		foreach($this->values as $index => $tmp)
		{
			if($tmp[self::KEY_Q] < $q)
			{
				array_splice($this->values, $index, 0, [[self::KEY_VAL => $val, self::KEY_Q => $q]]);
				
				return;
			}
		}
		
		// Append remainder
		$this->values[] = [self::KEY_VAL => $val, self::KEY_Q => $q];
	}
public function addValue ( $ value , $ q = 1.0 ) { $ val = $ this -> parseValue ( $ value ) ; $ q = floatval ( $ q ) ; if ( $ q > 1 ) { $ q = 1.0 ; } if ( $ q < 0 ) { $ q = 0.0 ; } // Ensure an existing element with the same value is removed.
 foreach ( $ this -> values as $ index => $ tmp ) { if ( $ tmp [ self :: KEY_VAL ] == $ val ) { array_splice ( $ this -> values , $ index , 1 ) ; break ; } } // Insert new value at position denoted by q value. foreach ( $ this -> values as $ index => $ tmp ) { if ( $ tmp [ self :: KEY_Q ] < $ q ) { array_splice ( $ this -> values , $ index , 0 , [ [ self :: KEY_VAL => $ val , self :: KEY_Q => $ q ] ] ) ; return ; } } // Append remainder $ this -> values [ ] = [ self :: KEY_VAL => $ val , self :: KEY_Q => $ q ] ; }
Add a value to the header, uses a modified version of insertion sort.

@param mixed $value
@param float $q
Add a value to the header uses a modified version of insertion sort .