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:
Nikita Popov 2019-02-26 15:32:18 +01:00
parent 528aa7932a
commit a31f46421d
113 changed files with 1402 additions and 486 deletions

View file

@ -153,7 +153,9 @@ static int pdo_sqlite_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_d
pdo_sqlite_error_stmt(stmt);
return 0;
} else {
convert_to_string(parameter);
if (!try_convert_to_string(parameter)) {
return 0;
}
}
if (SQLITE_OK == sqlite3_bind_blob(S->stmt, param->paramno + 1,
@ -176,7 +178,9 @@ static int pdo_sqlite_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_d
return 1;
}
} else {
convert_to_string(parameter);
if (!try_convert_to_string(parameter)) {
return 0;
}
if (SQLITE_OK == sqlite3_bind_text(S->stmt, param->paramno + 1,
Z_STRVAL_P(parameter),
Z_STRLEN_P(parameter),