diff options
author | Derick Rethans <github@derickrethans.nl> | 2019-03-17 14:38:11 -0400 |
---|---|---|
committer | Derick Rethans <github@derickrethans.nl> | 2019-03-17 14:38:11 -0400 |
commit | 0325e78f4f786e927e926299380fac6fd10bc6c4 (patch) | |
tree | 6e7d74ab36718de422d4a06c147c63bb260085d9 /ext/date/php_date.c | |
parent | 33d428252699b679e420d414507fb0c5db4b3eac (diff) | |
parent | 7e7ef44fab154e972a4677c579e73cb9ec175511 (diff) | |
download | php-git-0325e78f4f786e927e926299380fac6fd10bc6c4.tar.gz |
Merge branch 'PHP-7.3' into PHP-7.4
Diffstat (limited to 'ext/date/php_date.c')
-rw-r--r-- | ext/date/php_date.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c index d218d011d8..ec3ead6f2a 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -547,6 +547,7 @@ static const zend_function_entry date_funcs_period[] = { PHP_ME(DatePeriod, getStartDate, NULL, ZEND_ACC_PUBLIC) PHP_ME(DatePeriod, getEndDate, NULL, ZEND_ACC_PUBLIC) PHP_ME(DatePeriod, getDateInterval, NULL, ZEND_ACC_PUBLIC) + PHP_ME(DatePeriod, getRecurrences, NULL, ZEND_ACC_PUBLIC) PHP_FE_END }; @@ -4729,6 +4730,28 @@ PHP_METHOD(DatePeriod, getDateInterval) } /* }}} */ +/* {{{ proto int DatePeriod::getRecurrences() + Get recurrences. +*/ +PHP_METHOD(DatePeriod, getRecurrences) +{ + php_period_obj *dpobj; + php_date_obj *dateobj; + + if (zend_parse_parameters_none() == FAILURE) { + return; + } + + dpobj = Z_PHPPERIOD_P(ZEND_THIS); + + if (0 == dpobj->recurrences - dpobj->include_start_date) { + return; + } + + RETURN_LONG(dpobj->recurrences - dpobj->include_start_date); +} +/* }}} */ + static int check_id_allowed(char *id, zend_long what) /* {{{ */ { if (what & PHP_DATE_TIMEZONE_GROUP_AFRICA && strncasecmp(id, "Africa/", 7) == 0) return 1; |