Duplicate the borders if needed

@param  &array $val

@return void
518225
protected function duplicateBorder(&$val)
    {
        // 1 value => L => RTB
        if (count($val) == 1) {
            $val[1] = $val[0];
            $val[2] = $val[0];
            $val[3] = $val[0];
        // 2 values => L => R & T => B
        } elseif (count($val) == 2) {
            $val[2] = $val[0];
            $val[3] = $val[1];
        // 3 values => T => B
        } elseif (count($val) == 3) {
            $val[3] = $val[1];
        }
    }
204589
public void put(double[] val) {
    assert (val.length == elements.length);
    wsum += 1.0;
    for(int i = 0; i < elements.length; i++) {
      final double delta = val[i] - elements[i];
      elements[i] += delta / wsum;
    }
  }
931342
public function setRawMimeDirValue($val)
    {
        $val = 'TRUE' === strtoupper($val) ? true : false;
        $this->setValue($val);
    }
1126714
protected function _duplicate()
    {
        $this->dupDocComment();
        $this->setModifier($this->node->flags);
        $default = $this->node->props[0]->default;
        $this->setDefault($default);
        $this->addStmts($this->node->stmts);
    }
524610
protected function Div( $val )
	{
		$val = $this->getOtherValue( $val );
		if ( $val == 0 )
		{
			return new FloatProxy( $this->_value >= 0 ? INF : -INF );
		}

	    return new FloatProxy( $this->_value / $val );
	}
1010424
function set_background($val)
    {
        $val = trim($val);
        $important = isset($this->_important_props["background"]);

        if ($val === "none") {
            $this->_set_style("background_image", "none", $important);
            $this->_set_style("background_color", "transparent", $important);
        } else {
            $pos = array();
            $tmp = preg_replace("/\s*\,\s*/", ",", $val); // when rgb() has spaces
            $tmp = preg_split("/\s+/", $tmp);

            foreach ($tmp as $attr) {
                if (mb_substr($attr, 0, 3) === "url" || $attr === "none") {
                    $this->_set_style("background_image", $this->_image($attr), $important);
                } elseif ($attr === "fixed" || $attr === "scroll") {
                    $this->_set_style("background_attachment", $attr, $important);
                } elseif ($attr === "repeat" || $attr === "repeat-x" || $attr === "repeat-y" || $attr === "no-repeat") {
                    $this->_set_style("background_repeat", $attr, $important);
                } elseif (($col = $this->munge_color($attr)) != null) {
                    $this->_set_style("background_color", is_array($col) ? $col["hex"] : $col, $important);
                } else {
                    $pos[] = $attr;
                }
            }

            if (count($pos)) {
                $this->_set_style("background_position", implode(" ", $pos), $important);
            }
        }

        //see __set and __get, on all assignments clear cache, not needed on direct set through __set
        $this->_prop_cache["background"] = null;
        $this->_props["background"] = $val;
    }
662513
function border_radius_expand($val, $k)
	{
		$b = [];

		if ($k === 'BORDER-RADIUS') {

			$hv = explode('/', trim($val));
			$prop = preg_split('/\s+/', trim($hv[0]));

			if (count($prop) == 1) {
				$b['TL-H'] = $b['TR-H'] = $b['BR-H'] = $b['BL-H'] = $prop[0];
			} elseif (count($prop) == 2) {
				$b['TL-H'] = $b['BR-H'] = $prop[0];
				$b['TR-H'] = $b['BL-H'] = $prop[1];
			} elseif (count($prop) == 3) {
				$b['TL-H'] = $prop[0];
				$b['TR-H'] = $b['BL-H'] = $prop[1];
				$b['BR-H'] = $prop[2];
			} elseif (count($prop) == 4) {
				$b['TL-H'] = $prop[0];
				$b['TR-H'] = $prop[1];
				$b['BR-H'] = $prop[2];
				$b['BL-H'] = $prop[3];
			}

			if (count($hv) == 2) {
				$prop = preg_split('/\s+/', trim($hv[1]));
				if (count($prop) == 1) {
					$b['TL-V'] = $b['TR-V'] = $b['BR-V'] = $b['BL-V'] = $prop[0];
				} elseif (count($prop) == 2) {
					$b['TL-V'] = $b['BR-V'] = $prop[0];
					$b['TR-V'] = $b['BL-V'] = $prop[1];
				} elseif (count($prop) == 3) {
					$b['TL-V'] = $prop[0];
					$b['TR-V'] = $b['BL-V'] = $prop[1];
					$b['BR-V'] = $prop[2];
				} elseif (count($prop) == 4) {
					$b['TL-V'] = $prop[0];
					$b['TR-V'] = $prop[1];
					$b['BR-V'] = $prop[2];
					$b['BL-V'] = $prop[3];
				}
			} else {
				$b['TL-V'] = Arrays::get($b, 'TL-H', 0);
				$b['TR-V'] = Arrays::get($b, 'TR-H', 0);
				$b['BL-V'] = Arrays::get($b, 'BL-H', 0);
				$b['BR-V'] = Arrays::get($b, 'BR-H', 0);
			}

			return $b;
		}

		// Parse 2
		$prop = preg_split('/\s+/', trim($val));

		if (count($prop) == 1) {
			$h = $v = $val;
		} else {
			$h = $prop[0];
			$v = $prop[1];
		}

		if ($h == 0 || $v == 0) {
			$h = $v = 0;
		}

		if ($k === 'BORDER-TOP-LEFT-RADIUS') {
			$b['TL-H'] = $h;
			$b['TL-V'] = $v;
		} elseif ($k === 'BORDER-TOP-RIGHT-RADIUS') {
			$b['TR-H'] = $h;
			$b['TR-V'] = $v;
		} elseif ($k === 'BORDER-BOTTOM-LEFT-RADIUS') {
			$b['BL-H'] = $h;
			$b['BL-V'] = $v;
		} elseif ($k === 'BORDER-BOTTOM-RIGHT-RADIUS') {
			$b['BR-H'] = $h;
			$b['BR-V'] = $v;
		}

		return $b;
	}
1007333
protected function Mul($val)
	{
		$result = $this->_value->getValue() * $val->getValue()->getValue();
		return new LongProxy( new Long( $result ) );
	}
705976
public void addNextValue(Object val) {
    if (this.numItems <= this.maxNumItems) {
      uniqItems.put(val.toString(), "1");
      this.numItems = this.uniqItems.size();
    }
  }
582778
protected function Mul( $val )
	{
		if ( ! $val instanceof ByteProxy ) throw new \InvalidArgumentException();
		return new IntProxy( $this->_value * $val->_value );
	}
1224872
private function setAutoMode($val) {
        $this->_defaultBehaviour           = $val;
        $_SESSION[$this->_sessionAutoName] = $this->_defaultBehaviour;
    }
548448
public function addFlash($val)
    {
        $this->resumeOrStartSession();
        $_SESSION[Session::FLASH_NEXT][$this->name][] = $val;
    }
506616
private function setRealBoolean(string $val):bool
    {
        if ($val === "true") {
            $val = true;
        } else {
            $val = false;
        }
        return ($val);
    }
928341
public function virtual($key, $val) {
		$this->vFields[$key]=$val;
		if (!empty($this->whitelist)) {
			$this->whitelist[] = $key;
			$this->whitelist = array_unique($this->whitelist);
		}
	}
1363652
protected function Mul( $val )
	{
		switch ( $val->GetValueCode() )
		{
		    case YearMonthDurationProxyFactory::Code:

		        return new YearMonthDurationProxy( YearMonthDurationValue::Multiply( /* YearMonthDurationValue */ $val->getValue(), Convert::ToDouble( $this->_value ) ) );

		    case DayTimeDurationProxyFactory::Code:

		        return new DayTimeDurationProxy( DayTimeDurationValue::Multiply( /* DayTimeDurationValue */ $val->getValue(), Convert::ToDouble( $this->_value ) ) );

		    default:
		        throw XPath2Exception::withErrorCodeAndParams("XPTY0004", Resources::BinaryOperatorNotDefined,
					array(
						"op:mul",
						SequenceType::WithTypeCodeAndCardinality( SequenceType::GetXmlTypeCodeFromObject( $this->getValue() ), XmlTypeCardinality::One ),
						SequenceType::WithTypeCodeAndCardinality( SequenceType::GetXmlTypeCodeFromObject( $val->getValue() ), XmlTypeCardinality::One )
					)
				);
		}
	}
1297454
public function set($name, $val)
    {
        $var = &$this->nestedValueRef($name, $this->data);

        // Mark changed
        if ($var !== $val) {
            $var = $val;
            $this->markChanged($name);
        }
        return $this;
    }
1194843
protected function Mul( $val )
	{
		if ( ! $val instanceof ValueProxy ) throw new \InvalidArgumentException();
		return new IntProxy( $this->_value * $val->getValue() );
	}