Skip to content

Commit 5d4c6c2

Browse files
committed
Just delete the TODO message
This reverts commit 066f041.
1 parent 066f041 commit 5d4c6c2

5 files changed

Lines changed: 5 additions & 54 deletions

File tree

NEWS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ PHP NEWS
6262
. Fixed bug GH-20426 (Spoofchecker::setRestrictionLevel() error message
6363
suggests missing constants). (DanielEScherzer)
6464
. Added grapheme_strrev (Yuya Hamada)
65-
. IntlDateFormatter::format() now accepts numeric-castable objects as
66-
date/time values. (Weilin Du)
6765

6866
- JSON:
6967
. Enriched JSON last error / exception message with error location.

UPGRADING

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,6 @@ PHP 8.6 UPGRADE NOTES
200200
. gmp_powm() modulo-by-zero now raises a DivisionByZeroError whose
201201
message includes the function name and argument index ($modulus).
202202

203-
- Intl:
204-
. IntlDateFormatter::format() now accepts objects that support numeric
205-
casting as date/time values.
206-
207203
- mysqli:
208204
. The return structure of mysqli_get_charset() no longer contains
209205
the undocumented "comment" element. The value of "charsetnr" is

ext/intl/common/common_date.cpp

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -202,28 +202,9 @@ U_CFUNC double intl_zval_to_millis(zval *z, intl_error *err)
202202
}
203203
}
204204
} else {
205-
zval casted;
206-
ZVAL_UNDEF(&casted);
207-
208-
if (Z_OBJ_HT_P(z)->cast_object(Z_OBJ_P(z), &casted, _IS_NUMBER) == SUCCESS) {
209-
if (EG(exception)) {
210-
} else if (Z_TYPE(casted) == IS_LONG) {
211-
rv = U_MILLIS_PER_SECOND * (double)Z_LVAL(casted);
212-
} else if (Z_TYPE(casted) == IS_DOUBLE) {
213-
rv = U_MILLIS_PER_SECOND * Z_DVAL(casted);
214-
} else {
215-
intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR,
216-
"invalid object type for date/time "
217-
"(IntlCalendar, DateTimeInterface, or numeric-castable object permitted)");
218-
}
219-
} else if (!EG(exception)) {
220-
intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR,
221-
"invalid object type for date/time "
222-
"(IntlCalendar, DateTimeInterface, or numeric-castable object permitted)");
223-
}
224-
if (!Z_ISUNDEF(casted)) {
225-
zval_ptr_dtor(&casted);
226-
}
205+
intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR,
206+
"invalid object type for date/time "
207+
"(only IntlCalendar and DateTimeInterface permitted)");
227208
}
228209
break;
229210
case IS_REFERENCE:

ext/intl/tests/dateformat_formatObject_numeric_object.phpt

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

ext/intl/tests/dateformat_format_error.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ var_dump(intl_get_error_message());
2121
?>
2222
--EXPECT--
2323
bool(false)
24-
string(160) "IntlDateFormatter::format(): invalid object type for date/time (IntlCalendar, DateTimeInterface, or numeric-castable object permitted): U_ILLEGAL_ARGUMENT_ERROR"
24+
string(140) "IntlDateFormatter::format(): invalid object type for date/time (only IntlCalendar and DateTimeInterface permitted): U_ILLEGAL_ARGUMENT_ERROR"
2525
bool(false)
26-
string(149) "datefmt_format(): invalid object type for date/time (IntlCalendar, DateTimeInterface, or numeric-castable object permitted): U_ILLEGAL_ARGUMENT_ERROR"
26+
string(129) "datefmt_format(): invalid object type for date/time (only IntlCalendar and DateTimeInterface permitted): U_ILLEGAL_ARGUMENT_ERROR"

0 commit comments

Comments
 (0)