diff options
author | Hannes Magnusson <bjori@php.net> | 2006-09-10 16:34:08 +0000 |
---|---|---|
committer | Hannes Magnusson <bjori@php.net> | 2006-09-10 16:34:08 +0000 |
commit | b6a5941b97697728a7e4904abedd33e2ff7f1d1a (patch) | |
tree | 63b3e751b96f5db29522345088c0ad15089e15df | |
parent | 73161f33d4911752ee9fb25e88353821a7733fcf (diff) | |
download | php-git-b6a5941b97697728a7e4904abedd33e2ff7f1d1a.tar.gz |
MFH: date_timezone_set() needs both arguments
MFH: throw exception in DateTimeZone::__construct() when no arguments are passed
-rw-r--r-- | ext/date/php_date.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 3408a18654..ab9f6e30d7 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1848,7 +1848,7 @@ PHP_FUNCTION(date_timezone_set) php_date_obj *dateobj; php_timezone_obj *tzobj; - if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O|O", &object, date_ce_date, &timezone_object, date_ce_timezone) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_date, &timezone_object, date_ce_timezone) == FAILURE) { RETURN_FALSE; } dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); @@ -1978,13 +1978,13 @@ PHP_METHOD(DateTimeZone, __construct) int tz_len; timelib_tzinfo *tzi = NULL; + php_set_error_handling(EH_THROW, NULL TSRMLS_CC); if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &tz, &tz_len)) { - php_set_error_handling(EH_THROW, NULL TSRMLS_CC); if (SUCCESS == timezone_initialize(&tzi, tz TSRMLS_CC)) { ((php_timezone_obj *) zend_object_store_get_object(getThis() TSRMLS_CC))->tz = tzi; } - php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } + php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); } PHP_FUNCTION(timezone_name_get) |