Compare commits

...
3 Commits
Author SHA1 Message Date
Julien Pauli 4217038ddb 5.5.8 2014-01-08 11:15:20 +01:00
Derick Rethans b534e94e22 Fixed (some of) add/sub.
This worked in PHP 5.4 already, but with the introduction of DateTimeImmutable
this code was not correctly merged.
2014-01-08 10:29:06 +01:00
Julien Pauli 98c3c87bb9 Prepare for 5.5.8RC1 2013-12-24 14:12:46 +01:00
4 changed files with 12 additions and 44 deletions

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2013, PHP 5.5.8
9 Jan 2014, PHP 5.5.8
- Core:
. Disallowed JMP into a finally block. (Laruence)
+1 -1
View File
@@ -120,7 +120,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=5
PHP_RELEASE_VERSION=8
PHP_EXTRA_VERSION="-dev"
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
+8 -40
View File
@@ -3137,33 +3137,16 @@ static void php_date_add(zval *object, zval *interval, zval *return_value TSRMLS
{
php_date_obj *dateobj;
php_interval_obj *intobj;
int bias = 1;
timelib_time *new_time;
dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
intobj = (php_interval_obj *) zend_object_store_get_object(interval TSRMLS_CC);
DATE_CHECK_INITIALIZED(intobj->initialized, DateInterval);
if (intobj->diff->have_weekday_relative || intobj->diff->have_special_relative) {
memcpy(&dateobj->time->relative, intobj->diff, sizeof(struct timelib_rel_time));
} else {
if (intobj->diff->invert) {
bias = -1;
}
memset(&dateobj->time->relative, 0, sizeof(struct timelib_rel_time));
dateobj->time->relative.y = intobj->diff->y * bias;
dateobj->time->relative.m = intobj->diff->m * bias;
dateobj->time->relative.d = intobj->diff->d * bias;
dateobj->time->relative.h = intobj->diff->h * bias;
dateobj->time->relative.i = intobj->diff->i * bias;
dateobj->time->relative.s = intobj->diff->s * bias;
}
dateobj->time->have_relative = 1;
dateobj->time->sse_uptodate = 0;
timelib_update_ts(dateobj->time, NULL);
timelib_update_from_sse(dateobj->time);
dateobj->time->have_relative = 0;
new_time = timelib_add(dateobj->time, intobj->diff);
timelib_time_dtor(dateobj->time);
dateobj->time = new_time;
}
/* {{{ proto DateTime date_add(DateTime object, DateInterval interval)
@@ -3204,7 +3187,7 @@ static void php_date_sub(zval *object, zval *interval, zval *return_value TSRMLS
{
php_date_obj *dateobj;
php_interval_obj *intobj;
int bias = 1;
timelib_time *new_time;
dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
@@ -3216,24 +3199,9 @@ static void php_date_sub(zval *object, zval *interval, zval *return_value TSRMLS
return;
}
if (intobj->diff->invert) {
bias = -1;
}
memset(&dateobj->time->relative, 0, sizeof(struct timelib_rel_time));
dateobj->time->relative.y = 0 - (intobj->diff->y * bias);
dateobj->time->relative.m = 0 - (intobj->diff->m * bias);
dateobj->time->relative.d = 0 - (intobj->diff->d * bias);
dateobj->time->relative.h = 0 - (intobj->diff->h * bias);
dateobj->time->relative.i = 0 - (intobj->diff->i * bias);
dateobj->time->relative.s = 0 - (intobj->diff->s * bias);
dateobj->time->have_relative = 1;
dateobj->time->sse_uptodate = 0;
timelib_update_ts(dateobj->time, NULL);
timelib_update_from_sse(dateobj->time);
dateobj->time->have_relative = 0;
new_time = timelib_sub(dateobj->time, intobj->diff);
timelib_time_dtor(dateobj->time);
dateobj->time = new_time;
}
/* {{{ proto DateTime date_sub(DateTime object, DateInterval interval)
+2 -2
View File
@@ -3,6 +3,6 @@
#define PHP_MAJOR_VERSION 5
#define PHP_MINOR_VERSION 5
#define PHP_RELEASE_VERSION 8
#define PHP_EXTRA_VERSION "-dev"
#define PHP_VERSION "5.5.8-dev"
#define PHP_EXTRA_VERSION ""
#define PHP_VERSION "5.5.8"
#define PHP_VERSION_ID 50508