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
|
@ -177,7 +177,9 @@ double_offset:
|
|||
} else if (Z_TYPE_P(arg) == IS_OBJECT || Z_TYPE_P(arg) == IS_STRING) {
|
||||
zend_long lval;
|
||||
double dval;
|
||||
convert_to_string_ex(arg);
|
||||
if (!try_convert_to_string(arg)) {
|
||||
return;
|
||||
}
|
||||
switch (is_numeric_string(Z_STRVAL_P(arg), Z_STRLEN_P(arg), &lval, &dval, 0)) {
|
||||
case IS_DOUBLE:
|
||||
zval_ptr_dtor(arg);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue