com php-src: Merge branch 'PHP-5.6': ext/date/php_date.c ext/date/php_date.h ext/date/tests/DateTime_verify.ph pt
| From: | Stanislav Malyshev | Date: | Wed, 01 Apr 2015 19:50:40 +0000 |
| Subject: | com php-src: Merge branch 'PHP-5.6': ext/date/php_date.c ext/date/php_date.h ext/date/tests/DateTime_verify.ph pt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86032@lists.php.net to get a copy of this message | ||
Commit: 4975019dd7077a83112b3ba1f7b4ddb9969da79b
Author: Stanislav Malyshev <stas@php.net> Wed, 1 Apr 2015 12:50:40 -0700
Parents: ec760d8fffe7e6f56b458d477dd2dfdda73329ec 2d9399af3514189375f34610acc33a34de44d772
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4975019dd7077a83112b3ba1f7b4ddb9969da79b
Log:
Merge branch 'PHP-5.6'
* PHP-5.6:
Revert "Merge branch 'PHP-5.5' into PHP-5.6"
Conflicts:
ext/date/php_date.c
ext/date/tests/DateTime_verify.phpt
Changed paths:
MM ext/date/php_date.c
MM ext/date/php_date.h
MM ext/date/tests/DateTime_verify.phpt
Diff:
diff --cc ext/date/php_date.c
index 7ca3aad,ca61fb7..8c6b2e5
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@@ -2835,54 -2912,28 +2830,26 @@@ PHP_METHOD(DateTime, __wakeup
}
/* }}} */
- /* {{{ proto DateTime::createFromImmutable(DateTimeImmutable object)
- Creates new DateTime object from an existing DateTimeImmutable object.
- */
- PHP_METHOD(DateTime, createFromImmutable)
- {
- zval *datetimeimmutable_object = NULL;
- php_date_obj *new_obj = NULL;
- php_date_obj *old_obj = NULL;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &datetimeimmutable_object,
date_ce_immutable) == FAILURE) {
- return;
- }
-
- php_date_instantiate(date_ce_date, return_value);
- old_obj = Z_PHPDATE_P(datetimeimmutable_object);
- new_obj = Z_PHPDATE_P(return_value);
-
- new_obj->time = timelib_time_ctor();
- *new_obj->time = *old_obj->time;
- if (old_obj->time->tz_abbr) {
- new_obj->time->tz_abbr = strdup(old_obj->time->tz_abbr);
- }
- if (old_obj->time->tz_info) {
- new_obj->time->tz_info = old_obj->time->tz_info;
- }
- }
- /* }}} */
-
/* Helper function used to add an associative array of warnings and errors to a zval */
-static void zval_from_error_container(zval *z, timelib_error_container *error)
+static void zval_from_error_container(zval *z, timelib_error_container *error) /* {{{ */
{
int i;
- zval *element;
+ zval element;
add_assoc_long(z, "warning_count", error->warning_count);
- MAKE_STD_ZVAL(element);
- array_init(element);
+ array_init(&element);
for (i = 0; i < error->warning_count; i++) {
- add_index_string(element, error->warning_messages[i].position,
error->warning_messages[i].message, 1);
+ add_index_string(&element, error->warning_messages[i].position,
error->warning_messages[i].message);
}
- add_assoc_zval(z, "warnings", element);
+ add_assoc_zval(z, "warnings", &element);
add_assoc_long(z, "error_count", error->error_count);
- MAKE_STD_ZVAL(element);
- array_init(element);
+ array_init(&element);
for (i = 0; i < error->error_count; i++) {
- add_index_string(element, error->error_messages[i].position,
error->error_messages[i].message, 1);
+ add_index_string(&element, error->error_messages[i].position,
error->error_messages[i].message);
}
- add_assoc_zval(z, "errors", element);
-}
+ add_assoc_zval(z, "errors", &element);
+} /* }}} */
/* {{{ proto array date_get_last_errors()
Returns the warnings and errors found while parsing a date/time string.
diff --cc ext/date/tests/DateTime_verify.phpt
index 6045274,c790974..3376896
--- a/ext/date/tests/DateTime_verify.phpt
+++ b/ext/date/tests/DateTime_verify.phpt
@@@ -27,9 -27,9 +27,9 @@@ object(ReflectionClass)#%d (1)
string(8) "DateTime"
}
..and get names of all its methods
- array(19) {
+ array(18) {
[0]=>
- &object(ReflectionMethod)#%d (2) {
+ object(ReflectionMethod)#%d (2) {
["name"]=>
string(11) "__construct"
["class"]=>
@@@ -50,112 -50,105 +50,105 @@@
string(8) "DateTime"
}
[3]=>
- &object(ReflectionMethod)#%d (2) {
+ object(ReflectionMethod)#%d (2) {
["name"]=>
- string(19) "createFromImmutable"
- ["class"]=>
- string(8) "DateTime"
- }
- [4]=>
- object(ReflectionMethod)#%d (2) {
- ["name"]=>
string(16) "createFromFormat"
["class"]=>
string(8) "DateTime"
}
- [5]=>
+ [4]=>
- &object(ReflectionMethod)#%d (2) {
+ object(ReflectionMethod)#%d (2) {
["name"]=>
string(13) "getLastErrors"
["class"]=>
string(8) "DateTime"
}
- [6]=>
+ [5]=>
- &object(ReflectionMethod)#%d (2) {
+ object(ReflectionMethod)#%d (2) {
["name"]=>
string(6) "format"
["class"]=>
string(8) "DateTime"
}
- [7]=>
+ [6]=>
- &object(ReflectionMethod)#%d (2) {
+ object(ReflectionMethod)#%d (2) {
["name"]=>
string(6) "modify"
["class"]=>
string(8) "DateTime"
}
- [8]=>
+ [7]=>
- &object(ReflectionMethod)#%d (2) {
+ object(ReflectionMethod)#%d (2) {
["name"]=>
string(3) "add"
["class"]=>
string(8) "DateTime"
}
- [9]=>
+ [8]=>
- &object(ReflectionMethod)#%d (2) {
+ object(ReflectionMethod)#%d (2) {
["name"]=>
string(3) "sub"
["class"]=>
string(8) "DateTime"
}
- [10]=>
+ [9]=>
- &object(ReflectionMethod)#%d (2) {
+ object(ReflectionMethod)#%d (2) {
["name"]=>
string(11) "getTimezone"
["class"]=>
string(8) "DateTime"
}
- [11]=>
+ [10]=>
- &object(ReflectionMethod)#%d (2) {
+ object(ReflectionMethod)#%d (2) {
["name"]=>
string(11) "setTimezone"
["class"]=>
string(8) "DateTime"
}
- [12]=>
+ [11]=>
- &object(ReflectionMethod)#%d (2) {
+ object(ReflectionMethod)#%d (2) {
["name"]=>
string(9) "getOffset"
["class"]=>
string(8) "DateTime"
}
- [13]=>
+ [12]=>
- &object(ReflectionMethod)#%d (2) {
+ object(ReflectionMethod)#%d (2) {
["name"]=>
string(7) "setTime"
["class"]=>
string(8) "DateTime"
}
- [14]=>
+ [13]=>
- &object(ReflectionMethod)#%d (2) {
+ object(ReflectionMethod)#%d (2) {
["name"]=>
string(7) "setDate"
["class"]=>
string(8) "DateTime"
}
- [15]=>
+ [14]=>
- &object(ReflectionMethod)#%d (2) {
+ object(ReflectionMethod)#%d (2) {
["name"]=>
string(10) "setISODate"
["class"]=>
string(8) "DateTime"
}
- [16]=>
+ [15]=>
- &object(ReflectionMethod)#%d (2) {
+ object(ReflectionMethod)#%d (2) {
["name"]=>
string(12) "setTimestamp"
["class"]=>
string(8) "DateTime"
}
- [17]=>
+ [16]=>
- &object(ReflectionMethod)#%d (2) {
+ object(ReflectionMethod)#%d (2) {
["name"]=>
string(12) "getTimestamp"
["class"]=>
string(8) "DateTime"
}
- [18]=>
+ [17]=>
- &object(ReflectionMethod)#%d (2) {
+ object(ReflectionMethod)#%d (2) {
["name"]=>
string(4) "diff"
["class"]=>