$params = [] php5.3.6 报语法错误 change by ahuo 2013-11-05 14:23
321755
public function remove($where, $params = array())
    {
        if (empty($where)) {
            return false;
        }

        $query = "DELETE FROM {$this->getLibName()} WHERE {$where}";
        $statement = $this->pdo->prepare($query);
        $statement->execute($params);
        $this->lastSql = $query;
        return $statement->rowCount();
    }
1160432
public function prepareParams($params)
    {
        $params = parent::prepareParams($params);
        // Whitelist based on https://bugs.php.net/bug.php?id=47802
        // And https://bugs.php.net/bug.php?id=47802
        $whitelist = array(
            'ASCII',
            'CP1250',
            'CP1251',
            'CP1252',
            'CP1256',
            'CP1257',
            'GREEK',
            'HEBREW',
            'LATIN1',
            'LATIN2',
            'LATIN5',
            'LATIN7',
            'SWE7',
            'UTF8',
            'UTF-8',
        );

        if (isset($params['settings']['charset']['value'])) {
            if (version_compare(PHP_VERSION, '5.3.6', '<')) {
                $charset = strtoupper($params['settings']['charset']['value']);

                if (!in_array($charset, $whitelist)) {
                    throw new PropelException(<<<EXCEPTION
Connection option "charset" cannot be used for MySQL connections in PHP versions older than 5.3.6.
    Please refer to http://www.propelorm.org/ticket/1360 for instructions and details about the implications of
    using a SET NAMES statement in the "queries" setting.
EXCEPTION
                );
                }
            } else {
                if (strpos($params['dsn'], ';charset=') === false) {
                    $params['dsn'] .= ';charset=' . $params['settings']['charset']['value'];
                    unset($params['settings']['charset']);
                }
            }
        }

        return $params;
    }
1340962
function update( $table, $data, $where = array(), $params = array() ) {

        if ( empty( $data ) ) return;

        $set = array();

        foreach ( $data as $column => $value ) {

            $set[] = $this->quoteIdentifier( $column ) . " = " . $this->quote( $value );

        }

        if ( !is_array( $where ) ) $where = array( $where );
        if ( !is_array( $params ) ) $params = array_slice( func_get_args(), 3 );

        $table = $this->rewriteTable( $table );
        $query = "UPDATE " . $this->quoteIdentifier( $table );
        $query .= " SET " . implode( ", ", $set );
        $query .= $this->getSuffix( $where );

        $this->onQuery( $query, $params );

        $statement = $this->prepare( $query );
        $statement->execute( $params );

        return $statement;

    }
102359
public function getChanges(array $params = [])
    {
        $path = '/'.$this->databaseName.'/_changes';

        $method = ((!isset($params['doc_ids']) || $params['doc_ids'] == null) ? 'GET' : 'POST');
        $response = '';

        if ($method == 'GET') {
            foreach ($params as $key => $value) {
                if (isset($params[$key]) === true && is_bool($value) === true) {
                    $params[$key] = ($value) ? 'true' : 'false';
                }
            }
            if (count($params) > 0) {
                $query = http_build_query($params);
                $path = $path.'?'.$query;
            }
            $response = $this->httpClient->request('GET', $path);
        } else {
            $path .= '?filter=_doc_ids';
            $response = $this->httpClient->request('POST', $path, json_encode($params));
        }
        if ($response->status != 200) {
            throw HTTPException::fromResponse($path, $response);
        }

        return $response->body;
    }
351316
public static function setParams(&$param)
    {
        $arr_req = array();
        foreach($param as $key=>$value){
            if(is_array($value)) {
                $arr_req[] = "${key}=".implode("&",$value);
            } else {
                if ($value == '') {
                    continue;
                }
                $arr_req[] = "${key}=${value}";
            }
        }
        $str = implode("&",$arr_req);

        return $str;
    }
1033129
public static function parse($params = [])
	{
		$obj = new Request();

		$obj->id = $params['id'];
		$obj->type = (int) $params['type'];

		switch ($obj->type) {
			case 1:
				$obj->name = $params['name'];
				$obj->url = $params['url'];
				$obj->method = strtoupper(trim($params['method']));

				$obj->setAuthorization($params['authorization']);
				$obj->setProxy($params['proxy']);
				$obj->setTimeout(empty($params['timeout']) ? null : $params['timeout']);

				// 设置默认请求头
				// $obj->headers['Content-Type'] = 'text/plain';

				// 处理请求数据
				switch ($obj->method)
				{
					// 这两种类型无需对参数做处理
					case Method::GET:
					case Method::HEAD:
						foreach( (array) $params['data'] as $item )
						{
							if ( 'text' == $item['type'] )
							{
								$obj->data[ $item['key'] ] = $item['value'];
							}
							else
							{
								// 暂未实现
							}
						}
						break;

					// 只有 PUT,POST,DELETE,OPTIONS,PATCH 支持内容体
					case Method::POST:
					case Method::PUT:
					case Method::DELETE:
					case Method::OPTIONS:
						$dataMode = strtolower( trim($params['dataMode']) );
						switch ($dataMode) {
							case 'params':
								foreach( (array) $params['data'] as $item )
								{
									if ( 'text' == $item['type'] )
									{
										$obj->data[ $item['key'] ] = $item['value'];
									}
									else if ( 'file' == $item['type'] )
									{
										$obj->headers['Content-Type'] = 'multipart/form-data';
										// file 内容暂不支持
									}
								}
								break;
							case 'urlencoded':
								$obj->headers['Content-Type'] = 'application/x-www-form-urlencoded';
								foreach( (array) $params['data'] as $item )
								{
									if ( 'text' == $item['type'] )
									{
										$obj->data[ $item['key'] ] = $item['value'];
									}
								}
								break;

							case 'raw-json':
								$obj->headers['Content-Type'] = 'application/json';
								$obj->data = $params['data']['value'];
								break;
							case 'raw-xml':
								$obj->headers['Content-Type'] = 'application/xml';
								$obj->data = $params['data']['value'];
								break;
							case 'raw-textxml':
								$obj->headers['Content-Type'] = 'text/xml';
								$obj->data = $params['data']['value'];
								break;
							case 'raw-html':
								$obj->headers['Content-Type'] = 'text/html';
								$obj->data = $params['data']['value'];
								break;							
							case 'raw-text':
								$obj->headers['Content-Type'] = 'text/plain';
								$obj->data = $params['data']['value'];
								break;
							case 'raw-binary':
							default:
								throw new Exception("Not supported request `dataMode`: {$dataMode}");
								break;
						}

						break;
					default:
						throw new Exception("Not supported request `method`: {$obj->method}");
						break;
				}

				// 设置请求头
				foreach( (array) $params['headers'] as $key => $val )
				{
					$obj->headers[$key] = $val;
				}

				// 设置断言规则
				
				// 设置变量提取规则

				break;
			case 2:
				$obj->delay = (int) $params['delay'];
				break;
			default:
				throw new Exception("Unknown request `type`: {$obj->type}");
				break;
		}

		return $obj;
	}
133815
public static function checkCanExec($params,$param)
	{
		$year = $month = $week = $day = $hour = $minute = $second = $seconds = 0;
		$lastRunTime = (int)$params['LastRunTime'];
		$startTime = (int)$param['StartTime'];
		$stopTime = (int)$param['StopTime'];
		// 还未到开始时间
		if($_SERVER['REQUEST_TIME'] < $startTime)
		{
			return false;
		}
		// 超过结束时间
		if($stopTime > 0 && $_SERVER['REQUEST_TIME'] > $stopTime)
		{
			return false;
		}
		switch((int)$param['Mode'])
		{
			case self::MODE_SECOND:
				$seconds = max((int)$param['Seconds'],1);
				$nextTime = $lastRunTime + $seconds;
				break;
			case self::MODE_EVERY_YEAR:
				$month = max((int)$param['Month'],1);
				$day = max((int)$param['Day'],1);
				$hour = max((int)$param['Hour'],0);
				$minute = max((int)$param['Minute'],0);
				$second = max((int)$param['Second'],0);
				
				$year = date('Y',$lastRunTime) + 1;
				break;
			case self::MODE_EVERY_MONTH:
				$day = max((int)$param['Day'],1);
				$hour = max((int)$param['Hour'],0);
				$minute = max((int)$param['Minute'],0);
				$second = max((int)$param['Second'],0);
				
				$nextMonth = strtotime('+1 month',$lastRunTime);
				$year = date('Y', $nextMonth);
				$month = date('m', $nextMonth);
				break;
			case self::MODE_EVERY_WEEK:
				// 周一-周日=1-7
				$hour = max((int)$param['Hour'],0);
				$minute = max((int)$param['Minute'],0);
				$second = max((int)$param['Second'],0);
				$weeks = is_array($param['Week']) ? $param['Week'] : array($param['Week']);
				sort($weeks);
				$lastTimeWeek = date('N',$lastRunTime);
				foreach($weeks as $week)
				{
					if($lastTimeWeek > $week)
					{
						$days = 7 - ($lastTimeWeek - $week);
					}
					else
					{
						$days = abs($week - $lastTimeWeek);
					}
					$lastNextTime = strtotime('+' . $days . 'days',$lastRunTime);
					$year = date('Y',$lastNextTime);
					$month = date('m',$lastNextTime);
					$day = date('d',$lastNextTime);
					$nextTime = strtotime("{$year}-{$month}-{$day} {$hour}:{$minute}:{$second}");
					if($nextTime > $lastRunTime)
					{
						break;
					}
				}
				if($nextTime <= $lastRunTime)
				{
					return false;
				}
				break;
			case self::MODE_EVERY_DAY:
				$hour = max((int)$param['Hour'],0);
				$minute = max((int)$param['Minute'],0);
				$second = max((int)$param['Second'],0);
				
				$nextDay = strtotime('+1 days',$lastRunTime);
				$year = date('Y', $nextDay);
				$month = date('m', $nextDay);
				$day = date('d',$nextDay);
				break;
			case self::MODE_EVERY_HOUR:
				$minute = max((int)$param['Minute'],0);
				$second = max((int)$param['Second'],0);
				
				$nextHour = strtotime('+1 hour',$lastRunTime);
				$year = date('Y', $nextHour);
				$month = date('m', $nextHour);
				$day = date('d',$nextHour);
				$hour = date('H',$nextHour);
				break;
			default:
				return false;
		}
		if(!isset($nextTime))
		{
			$nextTime = strtotime("{$year}-{$month}-{$day} {$hour}:{$minute}:{$second}");
		}
		return $_SERVER['REQUEST_TIME'] >= $nextTime;
	}
550687
public static function decodeParams($params)
    {
        if(!$params) {
            return [];
        }
        $paramsArrayList = json_decode(json_encode($params), true);
        $decodedParams = [];
        foreach($paramsArrayList as $paramKey=>$paramValue){
            if(is_array($paramValue)) {
                foreach($paramValue as $languageSlug=>$langParamValue){
                    if($languageSlug == App::getLocale()) {
                        $decodedParams[$paramKey] = $langParamValue;
                        break;
                    }else{
                        $decodedParams[$paramKey] = "";
                    }
                }
            }else{
                $decodedParams[$paramKey] = $paramValue;
            }
        }
        return $decodedParams;
    }
1060822
def params_array(object)
      case object
      when Array then object
      when Hash then object.to_a
      when RequestProxy
        tmp = object.path.split('?')
        params = tmp[1] ? params_decode(tmp[1]) : []
        if object.post? && object.headers['Content-Type'].to_s.start_with?('application/x-www-form-urlencoded')
          params.concat params_decode(object.body)
        end
        params
      else
        raise "error: cannot convert #{object.class} object to params array"
      end
    end
285728
private static function getParamsToSign(
        array $params,
        array $ignoreParamKeys = [],
        int $currentLevel = 1,
        string $prefix = ''
    ): array
    {
        $paramsToSign = [];
        foreach ($params as $key => $value) {
            if ((in_array($key, $ignoreParamKeys) && $currentLevel == 1)) {
                continue;
            }
            $paramKey = ($prefix ? $prefix . ':' : '') . $key;
            if (is_array($value)) {
                if ($currentLevel >= self::MAXIMUM_RECURSION_DEPTH) {
                    $paramsToSign[$paramKey] = (string)$paramKey.':';
                } else {
                    $subArray = self::getParamsToSign($value, $ignoreParamKeys, $currentLevel + 1, $paramKey);
                    $paramsToSign = array_merge($paramsToSign, $subArray);
                }
            } else {
                if (is_bool($value)) {
                    $value = $value ? '1' : '0';
                } else {
                    $value = (string)$value;
                }
                $paramsToSign[$paramKey] = (string)$paramKey.':'.$value;
            }
        }
        if ($currentLevel == 1) {
            ksort($paramsToSign, SORT_NATURAL);
        }
        return $paramsToSign;
    }
507979
public function checkParams(array $params, &$error = null)
    {
        $result = array();
        foreach ($this->paramsReq as $param) {
            if (!array_key_exists($param, $params)) {
                $error = 'required '.$param;
                return false;
            }
            $result[$param] = $params[$param];
        }
        foreach ($this->paramsDefault as $param => $default) {
            if (array_key_exists($param, $params)) {
                $result[$param] = $params[$param];
            } else {
                $result[$param] = $default;
            }
        }
        return $result;
    }
1237513
private function cleanParams(array $params = [])
    {
        if (isset($params['project'])) {
            $apiProject = $this->client->project;
            $params['project_id'] = $apiProject->getIdByName($params['project']);
            unset($params['project']);
            if (isset($params['category'])) {
                $apiIssueCategory = $this->client->issue_category;
                $params['category_id'] = $apiIssueCategory->getIdByName($params['project_id'], $params['category']);
                unset($params['category']);
            }
        }
        if (isset($params['status'])) {
            $apiIssueStatus = $this->client->issue_status;
            $params['status_id'] = $apiIssueStatus->getIdByName($params['status']);
            unset($params['status']);
        }
        if (isset($params['tracker'])) {
            $apiTracker = $this->client->tracker;
            $params['tracker_id'] = $apiTracker->getIdByName($params['tracker']);
            unset($params['tracker']);
        }
        if (isset($params['assigned_to'])) {
            $apiUser = $this->client->user;
            $params['assigned_to_id'] = $apiUser->getIdByUsername($params['assigned_to']);
            unset($params['assigned_to']);
        }
        if (isset($params['author'])) {
            $apiUser = $this->client->user;
            $params['author_id'] = $apiUser->getIdByUsername($params['author']);
            unset($params['author']);
        }

        return $params;
    }
1266213
private static function _getValue($params, $keys, $keysCount, &$ancestorExist, $keyPrefix = '', &$cachedKeyValues = null)
    {
        $keyPath = $keyPrefix;
        $siblings = $params;
        $value = $params;

        if ($keysCount > 1) {
            // 查询缓存
            if ($cachedKeyValues !== null) {

                // todo 如果没有*号, 没必要重新合成路径
                $prefix = $keyPrefix;
                for ($i = 0; $i < $keysCount - 1; $i++) {
                    $key = $keys[$i];
                    if ($prefix === '')
                        $prefix = $key;
                    else if (is_integer($key) || $key === '*')
                        $prefix .= "[$key]";
                    else
                        $prefix .= ".$key";
                }

//                if (array_key_exists($prefix, $cachedKeyValues)) {
//                    echo "\n命中: key=$prefix" . ", value=" . $cachedKeyValues[$prefix] . "\n";
//                }
            }
        }

        for ($n = 0; $n < $keysCount; $n++) {
            $siblings = $value;
            $keyPrefix = $keyPath;

            $key = $keys[$n];
            if ($key === '*') {
                self::validateArr($siblings, null, $keyPrefix);
                $c = count($siblings);
                if ($c > 0) {
                    $subKeys = array_slice($keys, $n + 1);
                    $subKeysCount = $keysCount - $n - 1;

                    if ($subKeysCount) // *号后面还有keys
                    {
                        $values = [];
                        $ancestorExist = false;
                        for ($i = 0; $i < $c; $i++) {
                            $element = $siblings[$i];
                            $keyPath = $keyPrefix . "[$i]";
                            $aAncestorExist = false;
                            $aValue = self::_getValue($element, $subKeys, $subKeysCount, $aAncestorExist, $keyPath, $cachedKeyValues);
                            if ($aAncestorExist) {
                                $values[] = $aValue;
                                $ancestorExist = true;
                            }
//                            self::_validate($element, $subKeys, $subKeysCount, $validator, $keyPath, $ignoreRequired, $cachedKeyValues);
                        }
                    } else // *号是最后一级
                    {
                        $values = $siblings;

                        // todo 缓存数组本身的没什么用, 因为提取不到.
                        if ($cachedKeyValues !== null && $keyPrefix) {
                            $cachedKeyValues[$keyPrefix] = $siblings;
//                            echo "\n缓存: keyPrefix=$keyPrefix, key=$keyPath" . ", value=$siblings\n";
                        }
                    }
                    return $values;
                } else // 'items[*]' => 'Required' 要求items至少有1个元素, 但上面的循环不检测items==[]的情况
                    $value = null; // 这里是针对$value==[]这种情况的特殊处理
            } else {
                if (is_integer($key))
                    self::validateArr($siblings, null, $keyPrefix);
                else
                    self::validateObj($siblings, null, $keyPrefix);
                $value = @$siblings[$key];
            }

            if ($keyPrefix === '')
                $keyPath = $key;
            else if (is_integer($key) || $key === '*')
                $keyPath = $keyPrefix . "[$key]";
            else
                $keyPath = "$keyPrefix.$key";

            if ($value === null) {
                $n++;
                break;
            }
        }

        // 到这里$n表示当前的$value是第几层. 取值在[1, $keysCount]之间, 也就是说 $n 只可能小于或等于$keysCount
        if ($n == $keysCount) {
            $ancestorExist = true;
        } else {
            $ancestorExist = false;
            if ($cachedKeyValues !== null) {
                for (; $n < $keysCount; $n++) {
                    $keyPrefix = $keyPath;

                    $key = $keys[$n];

                    if ($keyPrefix === '')
                        $keyPath = $key;
                    else if (is_integer($key) || $key === '*')
                        $keyPath = $keyPrefix . "[$key]";
                    else
                        $keyPath = "$keyPrefix.$key";
                }
                $siblings = null;
            }
        }
        if ($cachedKeyValues !== null && $keyPrefix) {
            $cachedKeyValues[$keyPrefix] = $siblings; // 将父级数据缓存起来
//            echo "\n缓存: keyPrefix=$keyPrefix, key=$keyPath" . ", value=$siblings\n";
        }
        return $value;
    }
433423
public function bind(array $param) {
		foreach ($param as $key => $value) {
			if (is_null($value)) {
				$type = \PDO::PARAM_NULL;
			} else if (is_bool($value)) {
				$type = \PDO::PARAM_BOOL;
			} else if (is_int($value)) {
				$type = \PDO::PARAM_INT;
			} else {
				$type = \PDO::PARAM_STR;
			}
			$this->result->bindValue(is_int($key) ? ++$key : $key, $value, $type);
		}
	}
582513
function $asce(params) {
    if (Array.isArray(params) && params.every(p => typeof p === 'number')) {
        return params.sort((a, b) => a - b);
    }
    throw new Error('$asce expects an array of number');
}
475470
function modify( $tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters,
                     $placement )
    {
        if ( $operatorName == $this->LocaleFetchName )
        {
            if ( $operatorValue !== null )
            {
                $localeString = $operatorValue;
            }
            else
            {
                if ( count( $operatorParameters ) < 1 )
                {
                    $tpl->missingParameter( $operatorName, 'localestring' );
                    return;
                }
                $localeString = $tpl->elementValue( $operatorParameters[0], $rootNamespace, $currentNamespace, $placement, true );
            }
            $locale = eZLocale::instance( $localeString );
            $operatorValue = $locale;
            return;
        }
        $locale = eZLocale::instance();
        if ( $operatorName == $this->GetTimeName )
        {
            $timestamp = $operatorValue;
            if ( $timestamp === null )
                $timestamp = $namedParameters['timestamp'];

            if ( !$timestamp )
                $timestamp = time();

            $info = getdate( $timestamp );
            $week = date( 'W', $timestamp );
            if ( $info['wday'] == 0 )
                ++$week;
            $operatorValue = array( 'seconds' => $info['seconds'],
                                    'minutes' => $info['minutes'],
                                    'hours' => $info['hours'],
                                    'day' => $info['mday'],
                                    'month' => $info['mon'],
                                    'year' => $info['year'],
                                    'weeknumber' => $week,
                                    'weekday' => $info['wday'],
                                    'yearday' => $info['yday'],
                                    'epoch' => $info[0] );
        }
        else if ( $operatorName == $this->MakeTimeName )
        {
            $parameters = array();
            if ( $namedParameters['hour'] !== false )
                $parameters[] = $namedParameters['hour'];
            if ( $namedParameters['minute'] !== false )
                $parameters[] = $namedParameters['minute'];
            if ( $namedParameters['second'] !== false )
                $parameters[] = $namedParameters['second'];
            if ( $namedParameters['month'] !== false )
                $parameters[] = $namedParameters['month'];
            {
                if ( $namedParameters['day'] !== false )
                    $parameters[] = $namedParameters['day'];
                {
                    if ( $namedParameters['year'] !== false )
                        $parameters[] = $namedParameters['year'];
                    {
                        if ( $namedParameters['dst'] !== false )
                            $parameters[] = $namedParameters['dst'];
                    }
                }
            }

            $operatorValue = count( $parameters ) == 0 ? time() : call_user_func_array( 'mktime', $parameters );
        }
        else if ( $operatorName == $this->MakeDateName )
        {
            $parameters = array( 0, 0, 0 );
            if ( $namedParameters['month'] !== false )
                $parameters[] = $namedParameters['month'];
            {
                if ( $namedParameters['day'] !== false )
                    $parameters[] = $namedParameters['day'];
                {
                    if ( $namedParameters['year'] !== false )
                        $parameters[] = $namedParameters['year'];
                    {
                        if ( $namedParameters['dst'] !== false )
                            $parameters[] = $namedParameters['dst'];
                    }
                }
            }
            $operatorValue = call_user_func_array( 'mktime', $parameters );
        }
        else if ( $operatorName == $this->CurrentDateName )
        {
            $operatorValue = time();
        }
        else if ( $operatorName == $this->DateTimeName )
        {
            $class = $namedParameters['class'];
            if ( $class === null )
                return;
            if ( $class == 'custom' )
            {
                $operatorValue = $locale->formatDateTimeType( $namedParameters['data'], $operatorValue );
            }
            else
            {
                $dtINI = eZINI::instance( 'datetime.ini' );
                $formats = $dtINI->variable( 'ClassSettings', 'Formats' );
                if ( array_key_exists( $class, $formats ) )
                {
                    $classFormat = $formats[$class];
                    $operatorValue = $locale->formatDateTimeType( $classFormat, $operatorValue );
                }
                else
                    $tpl->error( $operatorName, "DateTime class '$class' is not defined", $placement );
            }
        }
        else if ( $operatorName == $this->LocaleName )
        {
            $type = $namedParameters['type'];
            if ( $type === null )
                return;

            $localeString = $namedParameters['locale'];
            $param = $namedParameters['param'];

            // change locale if need
            if ( $localeString )
                $locale = eZLocale::instance( $localeString );

            $method = $locale->getFormattingFunction( $type );
            if ( $method )
            {
                switch ( $type )
                {
                    case 'currency':
                        {
                            if ( $param === false )
                                $param = $locale->attribute( 'currency_symbol' );

                            $operatorValue = $locale->$method( $operatorValue, $param );
                        } break;

                    default:
                        {
                            $operatorValue = $locale->$method( $operatorValue );
                        } break;
                }
            }
            else
            {
                $tpl->error( $operatorName, "Unknown locale type: '$type'", $placement );
            }
        }
    }
627896
function setExdate( $exdates, $params=FALSE ) {
    $exdate = array();
    $exdate['params'] = $this->_setParams( $params, array( 'VALUE' => 'DATE-TIME' ) );
    $parno  = ( isset( $exdate['params']['TZID'] )) ? 6 : null;
    $parno  = $this->_existRem( $exdate['params'], 'VALUE', 'DATE-TIME', 7, $parno );
    if( !isset( $parno )) $parno = $this->_existRem( $exdate['params'], 'VALUE', 'DATE', 3 );
    foreach( $exdates as $eix => $theExdate ) {
      if(  is_array( $theExdate ) &&
         ( in_array( count( $theExdate ), array( 3, 4, 6, 7 )))) {
        if( isset( $exdate['params']['TZID'] ))
          $theExdate['tz'] = $exdate['params']['TZID'];
        if( !isset( $parno )) {
          if( 4 < count( $theExdate ))
            $parno = 7;
          else
            $parno = 3;
        }
        $exdatea   = $this->_date_time_array( $theExdate, $parno );
      }
      elseif( is_array( $theExdate ) && isset( $theExdate['timestamp'] )) {
        if( isset( $exdate['params']['TZID'] ))
          $theExdate['tz'] = $exdate['params']['TZID'];
        $tz        = ( isset( $theExdate['tz'] )) ? ' '.$theExdate['tz'] : null;
        if( !isset( $parno ))
          $parno   = ( !empty( $tz )) ? 7 : 6;
        $exdatea   = $this->_date_time_string( date( 'Y-m-d H:i:s', $theExdate['timestamp'] ).$tz, $parno );
      }
      elseif( 8 <= strlen( trim( $theExdate ))) { // ex. 2006-08-03 10:12:18
        $exdatea   = $this->_date_time_string( $theExdate, $parno );
        if( isset( $exdate['params']['TZID'] ))
          $exdatea['tz'] = $exdate['params']['TZID'];
      }
      if( !isset( $parno )) {
        $parno     = count( $exdatea );
        if( 6 == $parno )
          $parno   = 7;
      }
      if( isset( $exdatea['tz'] ))
        $exdatea['tz'] = (string) $exdatea['tz'];
      $exdate['value'][] = $exdatea;
    }
    if( 0 < count( $exdate['value'] )) {
      if( 3 == $parno ) {
        $exdate['params']['VALUE'] = 'DATE';
        foreach( $exdate['value'] as $eix => $exdatea )
          unset( $exdate['value'][$eix]['tz'] );
        unset( $exdate['params']['TZID'] );
      }
      if( !empty( $exdate['value'][0]['tz'] )   &&
           ( $exdate['value'][0]['tz'] != 'Z' ) &&
        ( !( in_array($exdate['value'][0]['tz']{0}, array( '+', '-' )) &&
             ctype_digit( substr( $exdate['value'][0]['tz'], 1 ))) &&
          !ctype_digit( $exdate['value'][0]['tz'] ) ) ) {
        $exdate['params']['TZID'] = $exdate['value'][0]['tz'];
        foreach( $exdate['value'] as $exix => $exdatea ) {
          if( !empty( $exdate['value'][0]['tz'] )   &&
               ( $exdate['value'][0]['tz'] != 'Z' ) &&
            ( !( in_array($exdate['value'][0]['tz']{0}, array( '+', '-' )) &&
                 ctype_digit( substr( $exdate['value'][0]['tz'], 1 ))) &&
              !ctype_digit( $exdate['value'][0]['tz'] ) ) )
            unset( $exdate['value'][$exix]['tz'] );
        }
      }
      elseif( isset( $exdate['params']['TZID'] ))
        unset( $exdate['params']['TZID'] );
      $this->exdate[] = $exdate;
    }
  }