public static function generate_nested_array($array_map, $map_keys, $bind_value)
    {

        $reference = &$array_map;

        while (count($map_keys) > 0) {
            // get next first key
            $new_map = array_shift($map_keys);

            // if $reference isn't an array already, make it one
            if (!is_array($reference)) {
                $reference = array();
            }

            // moves the reference deeper
            $reference = &$reference[$new_map];
        }
        $reference = $bind_value;

        // returns the nested array
        return $array_map;
    }