Skip to content

Commit 2d9399a

Browse files
committed
Revert "Merge branch 'PHP-5.5' into PHP-5.6"
This reverts commit aa22e80, reversing changes made to 3e7f47c. Conflicts: ext/date/php_date.c
1 parent 978128b commit 2d9399a

File tree

6 files changed

+16
-87
lines changed

6 files changed

+16
-87
lines changed

NEWS

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ PHP NEWS
2323
. Implemented FR#69278 (HTTP2 support). (Masaki Kagaya)
2424
. Fixed bug #68739 (Missing break / control flow). (Laruence)
2525

26-
- Date:
27-
. Added DateTime::createFromImmutable(). (Trevor Suarez)
28-
2926
- Enchant:
3027
. Fixed bug #65406 (Enchant broker plugins are in the wrong place in windows
3128
builds). (Anatol)

UPGRADING

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@ PHP 5.6 UPGRADE NOTES
271271

272272
- Datetime:
273273
Added DatePeriod::getStartDate(), DatePeriod::getEndDate(), DatePeriod::getDateInterval() in 5.6.5.
274-
Added DateTime::createFromImmutable() in 5.6.8.
275274

276275
- GMP:
277276
Added gmp_root($a, $nth) and gmp_rootrem($a, $nth) for calculating nth roots.

ext/date/php_date.c

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_date_format, 0, 0, 2)
185185
ZEND_ARG_INFO(0, format)
186186
ZEND_END_ARG_INFO()
187187

188-
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_method_create_from_immutable, 0, 0, 1)
189-
ZEND_ARG_INFO(0, DateTimeImmutable)
190-
ZEND_END_ARG_INFO()
191-
192188
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_method_format, 0, 0, 1)
193189
ZEND_ARG_INFO(0, format)
194190
ZEND_END_ARG_INFO()
@@ -472,7 +468,6 @@ const zend_function_entry date_funcs_date[] = {
472468
PHP_ME(DateTime, __construct, arginfo_date_create, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
473469
PHP_ME(DateTime, __wakeup, NULL, ZEND_ACC_PUBLIC)
474470
PHP_ME(DateTime, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
475-
PHP_ME(DateTime, createFromImmutable, arginfo_date_method_create_from_immutable, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
476471
PHP_ME_MAPPING(createFromFormat, date_create_from_format, arginfo_date_create_from_format, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
477472
PHP_ME_MAPPING(getLastErrors, date_get_last_errors, arginfo_date_get_last_errors, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
478473
PHP_ME_MAPPING(format, date_format, arginfo_date_method_format, 0)
@@ -2786,7 +2781,7 @@ PHP_METHOD(DateTimeImmutable, createFromMutable)
27862781
php_date_obj *new_obj = NULL;
27872782
php_date_obj *old_obj = NULL;
27882783

2789-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &datetime_object, date_ce_date) == FAILURE) {
2784+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O!", &datetime_object, date_ce_date) == FAILURE) {
27902785
return;
27912786
}
27922787

@@ -2917,34 +2912,6 @@ PHP_METHOD(DateTime, __wakeup)
29172912
}
29182913
/* }}} */
29192914

2920-
/* {{{ proto DateTime::createFromImmutable(DateTimeImmutable object)
2921-
Creates new DateTime object from an existing DateTimeImmutable object.
2922-
*/
2923-
PHP_METHOD(DateTime, createFromImmutable)
2924-
{
2925-
zval *datetimeimmutable_object = NULL;
2926-
php_date_obj *new_obj = NULL;
2927-
php_date_obj *old_obj = NULL;
2928-
2929-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &datetimeimmutable_object, date_ce_immutable) == FAILURE) {
2930-
return;
2931-
}
2932-
2933-
php_date_instantiate(date_ce_date, return_value TSRMLS_CC);
2934-
old_obj = (php_date_obj *) zend_object_store_get_object(datetimeimmutable_object TSRMLS_CC);
2935-
new_obj = (php_date_obj *) zend_object_store_get_object(return_value TSRMLS_CC);
2936-
2937-
new_obj->time = timelib_time_ctor();
2938-
*new_obj->time = *old_obj->time;
2939-
if (old_obj->time->tz_abbr) {
2940-
new_obj->time->tz_abbr = strdup(old_obj->time->tz_abbr);
2941-
}
2942-
if (old_obj->time->tz_info) {
2943-
new_obj->time->tz_info = old_obj->time->tz_info;
2944-
}
2945-
}
2946-
/* }}} */
2947-
29482915
/* Helper function used to add an associative array of warnings and errors to a zval */
29492916
static void zval_from_error_container(zval *z, timelib_error_container *error)
29502917
{

ext/date/php_date.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ PHP_FUNCTION(getdate);
5050
PHP_METHOD(DateTime, __construct);
5151
PHP_METHOD(DateTime, __wakeup);
5252
PHP_METHOD(DateTime, __set_state);
53-
PHP_METHOD(DateTime, createFromImmutable);
5453
PHP_FUNCTION(date_create);
5554
PHP_FUNCTION(date_create_immutable);
5655
PHP_FUNCTION(date_create_from_format);

ext/date/tests/DateTime_createFromImmutable.phpt

Lines changed: 0 additions & 26 deletions
This file was deleted.

ext/date/tests/DateTime_verify.phpt

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ object(ReflectionClass)#%d (1) {
2727
string(8) "DateTime"
2828
}
2929
..and get names of all its methods
30-
array(19) {
30+
array(18) {
3131
[0]=>
3232
&object(ReflectionMethod)#%d (2) {
3333
["name"]=>
@@ -50,111 +50,104 @@ array(19) {
5050
string(8) "DateTime"
5151
}
5252
[3]=>
53-
&object(ReflectionMethod)#%d (2) {
54-
["name"]=>
55-
string(19) "createFromImmutable"
56-
["class"]=>
57-
string(8) "DateTime"
58-
}
59-
[4]=>
6053
&object(ReflectionMethod)#%d (2) {
6154
["name"]=>
6255
string(16) "createFromFormat"
6356
["class"]=>
6457
string(8) "DateTime"
6558
}
66-
[5]=>
59+
[4]=>
6760
&object(ReflectionMethod)#%d (2) {
6861
["name"]=>
6962
string(13) "getLastErrors"
7063
["class"]=>
7164
string(8) "DateTime"
7265
}
73-
[6]=>
66+
[5]=>
7467
&object(ReflectionMethod)#%d (2) {
7568
["name"]=>
7669
string(6) "format"
7770
["class"]=>
7871
string(8) "DateTime"
7972
}
80-
[7]=>
73+
[6]=>
8174
&object(ReflectionMethod)#%d (2) {
8275
["name"]=>
8376
string(6) "modify"
8477
["class"]=>
8578
string(8) "DateTime"
8679
}
87-
[8]=>
80+
[7]=>
8881
&object(ReflectionMethod)#%d (2) {
8982
["name"]=>
9083
string(3) "add"
9184
["class"]=>
9285
string(8) "DateTime"
9386
}
94-
[9]=>
87+
[8]=>
9588
&object(ReflectionMethod)#%d (2) {
9689
["name"]=>
9790
string(3) "sub"
9891
["class"]=>
9992
string(8) "DateTime"
10093
}
101-
[10]=>
94+
[9]=>
10295
&object(ReflectionMethod)#%d (2) {
10396
["name"]=>
10497
string(11) "getTimezone"
10598
["class"]=>
10699
string(8) "DateTime"
107100
}
108-
[11]=>
101+
[10]=>
109102
&object(ReflectionMethod)#%d (2) {
110103
["name"]=>
111104
string(11) "setTimezone"
112105
["class"]=>
113106
string(8) "DateTime"
114107
}
115-
[12]=>
108+
[11]=>
116109
&object(ReflectionMethod)#%d (2) {
117110
["name"]=>
118111
string(9) "getOffset"
119112
["class"]=>
120113
string(8) "DateTime"
121114
}
122-
[13]=>
115+
[12]=>
123116
&object(ReflectionMethod)#%d (2) {
124117
["name"]=>
125118
string(7) "setTime"
126119
["class"]=>
127120
string(8) "DateTime"
128121
}
129-
[14]=>
122+
[13]=>
130123
&object(ReflectionMethod)#%d (2) {
131124
["name"]=>
132125
string(7) "setDate"
133126
["class"]=>
134127
string(8) "DateTime"
135128
}
136-
[15]=>
129+
[14]=>
137130
&object(ReflectionMethod)#%d (2) {
138131
["name"]=>
139132
string(10) "setISODate"
140133
["class"]=>
141134
string(8) "DateTime"
142135
}
143-
[16]=>
136+
[15]=>
144137
&object(ReflectionMethod)#%d (2) {
145138
["name"]=>
146139
string(12) "setTimestamp"
147140
["class"]=>
148141
string(8) "DateTime"
149142
}
150-
[17]=>
143+
[16]=>
151144
&object(ReflectionMethod)#%d (2) {
152145
["name"]=>
153146
string(12) "getTimestamp"
154147
["class"]=>
155148
string(8) "DateTime"
156149
}
157-
[18]=>
150+
[17]=>
158151
&object(ReflectionMethod)#%d (2) {
159152
["name"]=>
160153
string(4) "diff"

0 commit comments

Comments
 (0)