final protected function struct_to_assoc($struct) {
        $result=array();
        foreach($struct as $item) {
            if(array_key_exists('key', $item) && array_key_exists('value', $item)) {
                if(array_key_exists($item['key'], $result)) {
                    user_error('Duplicate key detected in struct entry, content overwritten by the last entry: [New: '.print_r($item, true).'] [Previous: '.print_r($result[$item['key']], true).']', E_USER_WARNING);
                }
                
                $result[$item['key']]=$item['value'];
            }else {
                user_error('Key/Value pair not detected in struct entry: '.print_r($item, true), E_USER_NOTICE);
            }
        }
        
        return $result;
    }