src/classes/CCArr.php
public static function merge() 
	{
		// get all arguments
		$arrs = func_get_args();
		$return = array();

		foreach ( $arrs as $arr )
		{
			if ( !is_array( $arr ) ) 
			{
				throw new \InvalidArgumentException('CCArr::merge - all arguments have to be arrays.');
			}

			foreach ( $arr as $key => $value ) 
			{	
				if ( array_key_exists( $key, $return ) ) 
				{
					if ( is_array( $value ) && is_array( $return[$key] ) ) 
					{
						$value = static::merge( $return[$key], $value );
					}
				}
				$return[$key] = $value;
			}
		}

		return $return;
	}
public static function merge() 
	{
		// get all arguments
		$arrs = func_get_args();
		$return = array();

		foreach ( $arrs as $arr )
		{
			if ( !is_array( $arr ) ) 
			{
				throw new \InvalidArgumentException('CCArr::merge - all arguments have to be arrays.');
			}

			foreach ( $arr as $key => $value ) 
			{	
				if ( array_key_exists( $key, $return ) ) 
				{
					if ( is_array( $value ) && is_array( $return[$key] ) ) 
					{
						$value = static::merge( $return[$key], $value );
					}
				}
				$return[$key] = $value;
			}
		}

		return $return;
	}
public static function merge ( ) { // get all arguments $ arrs = func_get_args ( ) ; $ return = array ( ) ; foreach ( $ arrs as $ arr ) { if ( ! is_array ( $ arr ) ) { throw new \ InvalidArgumentException ( 'CCArr::merge - all arguments have to be arrays.' ) ; } foreach ( $ arr as $ key => $ value ) { if ( array_key_exists ( $ key , $ return ) ) { if ( is_array ( $ value ) && is_array ( $ return [ $ key ] ) ) { $ value = static :: merge ( $ return [ $ key ] , $ value ) ; } } $ return [ $ key ] = $ value ; } } return $ return ; }
merge arrays recursivly together

@param array 		$array ...
@return array
merge arrays recursivly together