mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions And convert some object to string conversion related recoverable fatal errors into Error exceptions. Improve exception safety of internal code performing string conversions.
This commit is contained in:
parent
528aa7932a
commit
a31f46421d
113 changed files with 1402 additions and 486 deletions
|
@ -142,7 +142,9 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
|
|||
}
|
||||
dateStyle = timeStyle = (DateFormat::EStyle)Z_LVAL_P(format);
|
||||
} else {
|
||||
convert_to_string_ex(format);
|
||||
if (!try_convert_to_string(format)) {
|
||||
return;
|
||||
}
|
||||
if (Z_STRLEN_P(format) == 0) {
|
||||
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
|
||||
"datefmt_format_object: the format is empty", 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue