[php-src] master: Merge branch 'PHP-8.6'
| From: | Daniel Scherzer | Date: | Fri, 30 Oct 2026 19:51:29 +0000 |
| Subject: | [php-src] master: Merge branch 'PHP-8.6' | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-143035@lists.php.net to get a copy of this message | ||
Author: Daniel Scherzer (DanielEScherzer)
Date: 2026-10-30T12:51:07-07:00
Commit: https://github.com/php/php-src/commit/ec77bc22f585a01b13e3c699b5edfe394f65c64e
Raw diff: https://github.com/php/php-src/commit/ec77bc22f585a01b13e3c699b5edfe394f65c64e.diff
Merge branch 'PHP-8.6'
* PHP-8.6:
[
%pS migration] Use %pS in ext/pgsql (#23165)
Changed paths:
M ext/pgsql/pgsql.c
Diff:
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 90bb203e4a6d..3da143051867 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -327,7 +327,7 @@ static void _php_pgsql_notice_handler(void *l, const char *message)
zend_string *trimmed_message = _php_pgsql_trim_message(message);
if (PGG(log_notices)) {
- php_error_docref(NULL, E_NOTICE, "%s", ZSTR_VAL(trimmed_message));
+ php_error_docref(NULL, E_NOTICE, "%pS", trimmed_message);
}
ZVAL_STR(&tmp, trimmed_message);
@@ -694,7 +694,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (pgsql) {
PQfinish(pgsql);
}
- php_error_docref(NULL, E_WARNING, "Unable to connect to PostgreSQL server: %s",
ZSTR_VAL(msgbuf));
+ php_error_docref(NULL, E_WARNING, "Unable to connect to PostgreSQL server: %pS",
msgbuf);
zend_string_release(msgbuf);
goto err;
}
@@ -780,7 +780,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (pgsql) {
PQfinish(pgsql);
}
- php_error_docref(NULL, E_WARNING, "Unable to connect to PostgreSQL server: %s",
ZSTR_VAL(msgbuf));
+ php_error_docref(NULL, E_WARNING, "Unable to connect to PostgreSQL server: %pS",
msgbuf);
zend_string_release(msgbuf);
goto err;
}
@@ -791,7 +791,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (pgsql) {
PQfinish(pgsql);
}
- php_error_docref(NULL, E_WARNING, "Unable to connect to PostgreSQL server: %s",
ZSTR_VAL(msgbuf));
+ php_error_docref(NULL, E_WARNING, "Unable to connect to PostgreSQL server: %pS",
msgbuf);
zend_string_release(msgbuf);
goto err;
}
@@ -2132,8 +2132,8 @@ PHP_FUNCTION(pg_fetch_object)
if (UNEXPECTED(!constructor && ctor_params && zend_hash_num_elements(ctor_params)
> 0)) {
zend_argument_value_error(4,
- "must be empty when the specified class (%s) does not have a constructor",
- ZSTR_VAL(ce->name)
+ "must be empty when the specified class (%pS) does not have a constructor",
+ ce->name
);
RETURN_THROWS();
}
@@ -2267,9 +2267,9 @@ static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type,
bo
if (ZEND_NUM_ARGS() == 2) {
if (nullable_row) {
- zend_error(E_DEPRECATED, "Calling %s() with 2 arguments is deprecated, "
+ zend_error(E_DEPRECATED, "Calling %pS() with 2 arguments is deprecated, "
"use the 3-parameter signature with a null $row parameter instead",
- ZSTR_VAL(EX(func)->common.function_name));
+ EX(func)->common.function_name);
if (UNEXPECTED(EG(exception))) {
RETURN_THROWS();
}
@@ -4541,7 +4541,7 @@ PHP_PGSQL_API zend_result php_pgsql_meta_data(PGconn *pg_link, const
zend_string
tmp_name = php_strtok_r(src, ".", &tmp_name2);
if (!tmp_name) {
efree(src);
- zend_argument_value_error(2, "must be specified (%s)", ZSTR_VAL(table_name));
+ zend_argument_value_error(2, "must be specified (%pS)", table_name);
return FAILURE;
}
if (!tmp_name2 || !*tmp_name2) {
@@ -4573,7 +4573,7 @@ PHP_PGSQL_API zend_result php_pgsql_meta_data(PGconn *pg_link, const
zend_string
escaped = (char *)safe_emalloc(len, 2, 1);
new_len = PQescapeStringConn(pg_link, escaped, tmp_name2, len, &err);
if (err) {
- php_error_docref(NULL, E_WARNING, "Escaping table name '%s' failed",
ZSTR_VAL(table_name));
+ php_error_docref(NULL, E_WARNING, "Escaping table name '%pS' failed",
table_name);
efree(src);
efree(escaped);
smart_str_free(&querystr);
@@ -4589,7 +4589,7 @@ PHP_PGSQL_API zend_result php_pgsql_meta_data(PGconn *pg_link, const
zend_string
escaped = (char *)safe_emalloc(len, 2, 1);
new_len = PQescapeStringConn(pg_link, escaped, tmp_name, len, &err);
if (err) {
- php_error_docref(NULL, E_WARNING, "Escaping table namespace '%s' failed",
ZSTR_VAL(table_name));
+ php_error_docref(NULL, E_WARNING, "Escaping table namespace '%pS' failed",
table_name);
efree(src);
efree(escaped);
smart_str_free(&querystr);
@@ -4606,7 +4606,7 @@ PHP_PGSQL_API zend_result php_pgsql_meta_data(PGconn *pg_link, const
zend_string
pg_result = PQexec(pg_link, ZSTR_VAL(querystr.s));
if (PQresultStatus(pg_result) != PGRES_TUPLES_OK || (num_rows = PQntuples(pg_result)) == 0) {
- php_error_docref(NULL, E_WARNING, "Table '%s' doesn't exists",
ZSTR_VAL(table_name));
+ php_error_docref(NULL, E_WARNING, "Table '%pS' doesn't exists",
table_name);
smart_str_free(&querystr);
PQclear(pg_result);
return FAILURE;
@@ -4837,7 +4837,7 @@ static zend_string *php_pgsql_add_quotes(zend_string *src)
} \
/* raise error if it's not null and cannot be ignored */ \
else if (!(opt & PGSQL_CONV_IGNORE_NOT_NULL) && Z_TYPE_P(not_null) == IS_TRUE) { \
- php_error_docref(NULL, E_NOTICE, "Detected NULL for 'NOT NULL' field
'%s'", ZSTR_VAL(field)); \
+ php_error_docref(NULL, E_NOTICE, "Detected NULL for 'NOT NULL' field
'%pS'", field); \
err = 1; \
} \
}
@@ -4881,7 +4881,7 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string
*
}
if (!err && (def = zend_hash_find(Z_ARRVAL(meta), field)) == NULL) {
- php_error_docref(NULL, E_NOTICE, "Invalid field name (%s) in values",
ZSTR_VAL(field));
+ php_error_docref(NULL, E_NOTICE, "Invalid field name (%pS) in values", field);
err = 1;
}
if (!err && (type = zend_hash_str_find(Z_ARRVAL_P(def), "type",
sizeof("type") - 1)) == NULL) {
@@ -4939,7 +4939,7 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string
*
ZVAL_STRINGL(&new_val, "'f'", sizeof("'f'")-1);
}
else {
- zend_value_error("%s(): Field \"%s\" must be of type bool, invalid
PostgreSQL string boolean value \"%s\" given", get_active_function_name(),
ZSTR_VAL(field), Z_STRVAL_P(val));
+ zend_value_error("%s(): Field \"%pS\" must be of type bool, invalid
PostgreSQL string boolean value \"%pS\" given", get_active_function_name(), field,
Z_STR_P(val));
err = 1;
}
}
@@ -4971,7 +4971,7 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string
*
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- zend_type_error("%s(): Field \"%s\" must be of type string|null|int|bool, %s
given", get_active_function_name(), ZSTR_VAL(field), Z_STRVAL_P(type));
+ zend_type_error("%s(): Field \"%pS\" must be of type string|null|int|bool, %pS
given", get_active_function_name(), field, Z_STR_P(type));
}
break;
@@ -5013,7 +5013,7 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string
*
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- zend_type_error("%s(): Field \"%s\" must be of type int|null, %s given",
get_active_function_name(), ZSTR_VAL(field), Z_STRVAL_P(type));
+ zend_type_error("%s(): Field \"%pS\" must be of type int|null, %pS given",
get_active_function_name(), field, Z_STR_P(type));
}
break;
@@ -5058,7 +5058,7 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string
*
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- zend_type_error("%s(): Field \"%s\" must be of type %s|int|null, %s
given", get_active_function_name(), (data_type == PG_MONEY ? "money" :
"float"), ZSTR_VAL(field), Z_STRVAL_P(type));
+ zend_type_error("%s(): Field \"%s\" must be of type %pS|int|null, %pS
given", get_active_function_name(), (data_type == PG_MONEY ? "money" :
"float"), field, Z_STR_P(type));
}
break;
@@ -5125,11 +5125,11 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const
zend_string *
if (err) {
if (escape_err) {
php_error_docref(NULL, E_NOTICE,
- "String value escaping failed for PostgreSQL '%s' (%s)",
- Z_STRVAL_P(type), ZSTR_VAL(field));
+ "String value escaping failed for PostgreSQL '%pS' (%pS)",
+ Z_STR_P(type), field);
} else {
- zend_type_error("%s(): Field \"%s\" must be of type string|null, %s
given",
- get_active_function_name(), ZSTR_VAL(field), Z_STRVAL_P(type));
+ zend_type_error("%s(): Field \"%pS\" must be of type string|null, %pS
given",
+ get_active_function_name(), field, Z_STR_P(type));
}
}
break;
@@ -5172,7 +5172,7 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string
*
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- zend_type_error("%s(): Field \"%s\" must be of type int|null, %s given",
get_active_function_name(), ZSTR_VAL(field), zend_zval_value_name(val));
+ zend_type_error("%s(): Field \"%pS\" must be of type int|null, %s given",
get_active_function_name(), field, zend_zval_value_name(val));
}
break;
@@ -5207,9 +5207,9 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string
*
PGSQL_CONV_CHECK_IGNORE();
if (err) {
if (err == 2) {
- zend_value_error("%s(): Field \"%s\" must be a valid IPv4 or IPv6 address
string, \"%s\" given", get_active_function_name(), ZSTR_VAL(field), Z_STRVAL_P(val));
+ zend_value_error("%s(): Field \"%pS\" must be a valid IPv4 or IPv6 address
string, \"%pS\" given", get_active_function_name(), field, Z_STR_P(val));
} else {
- zend_type_error("%s(): Field \"%s\" must be of type string|null, given
%s", get_active_function_name(), ZSTR_VAL(field), zend_zval_value_name(val));
+ zend_type_error("%s(): Field \"%pS\" must be of type string|null, given
%s", get_active_function_name(), field, zend_zval_value_name(val));
}
}
break;
@@ -5242,7 +5242,7 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string
*
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- zend_type_error("%s(): Field \"%s\" must be of type string|null, %s
given", get_active_function_name(), ZSTR_VAL(field), Z_STRVAL_P(type));
+ zend_type_error("%s(): Field \"%pS\" must be of type string|null, %pS
given", get_active_function_name(), field, Z_STR_P(type));
}
break;
@@ -5272,7 +5272,7 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string
*
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- zend_type_error("%s(): Field \"%s\" must be of type string|null, %s
given", get_active_function_name(), ZSTR_VAL(field), Z_STRVAL_P(type));
+ zend_type_error("%s(): Field \"%pS\" must be of type string|null, %pS
given", get_active_function_name(), field, Z_STR_P(type));
}
break;
@@ -5302,7 +5302,7 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string
*
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- zend_type_error("%s(): Field \"%s\" must be of type string|null, %s
given", get_active_function_name(), ZSTR_VAL(field), Z_STRVAL_P(type));
+ zend_type_error("%s(): Field \"%pS\" must be of type string|null, %pS
given", get_active_function_name(), field, Z_STR_P(type));
}
break;
@@ -5349,7 +5349,7 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string
*
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- zend_type_error("%s(): Field \"%s\" must be of type string|null, %s
given", get_active_function_name(), ZSTR_VAL(field), Z_STRVAL_P(type));
+ zend_type_error("%s(): Field \"%pS\" must be of type string|null, %pS
given", get_active_function_name(), field, Z_STR_P(type));
}
break;
case PG_BYTEA:
@@ -5365,7 +5365,7 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string
*
tmp = PQescapeByteaConn(pg_link, (unsigned char *)Z_STRVAL_P(val), Z_STRLEN_P(val),
&to_len);
if (tmp == NULL) {
- php_error_docref(NULL, E_NOTICE, "Escaping value failed for %s field (%s)",
Z_STRVAL_P(type), ZSTR_VAL(field));
+ php_error_docref(NULL, E_NOTICE, "Escaping value failed for %pS field (%pS)",
Z_STR_P(type), field);
err = 1;
break;
}
@@ -5395,7 +5395,7 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string
*
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- zend_type_error("%s(): Field \"%s\" must be of type string|null, %s
given", get_active_function_name(), ZSTR_VAL(field), Z_STRVAL_P(type));
+ zend_type_error("%s(): Field \"%pS\" must be of type string|null, %pS
given", get_active_function_name(), field, Z_STR_P(type));
}
break;
@@ -5424,13 +5424,13 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const
zend_string *
}
PGSQL_CONV_CHECK_IGNORE();
if (err) {
- zend_type_error("%s(): Field \"%s\" must be of type string|null, %s
given", get_active_function_name(), ZSTR_VAL(field), Z_STRVAL_P(type));
+ zend_type_error("%s(): Field \"%pS\" must be of type string|null, %pS
given", get_active_function_name(), field, Z_STR_P(type));
}
break;
default:
/* should not happen */
- php_error_docref(NULL, E_NOTICE, "Unknown or system data type '%s' for
'%s'. Report error", Z_STRVAL_P(type), ZSTR_VAL(field));
+ php_error_docref(NULL, E_NOTICE, "Unknown or system data type '%pS' for
'%pS'. Report error", Z_STR_P(type), field);
err = 1;
break;
} /* switch */
@@ -5447,7 +5447,7 @@ PHP_PGSQL_API zend_result php_pgsql_convert(PGconn *pg_link, const zend_string
*
char *escaped = PQescapeIdentifier(pg_link, ZSTR_VAL(field), ZSTR_LEN(field));
if (escaped == NULL) {
/* This cannot fail because of invalid string but only due to failed memory allocation */
- php_error_docref(NULL, E_NOTICE, "Escaping field '%s' failed",
ZSTR_VAL(field));
+ php_error_docref(NULL, E_NOTICE, "Escaping field '%pS' failed", field);
err = 1;
break;
}
@@ -5544,7 +5544,7 @@ static inline zend_result build_tablename(smart_str *querystr, PGconn
*pg_link,
} else {
char *escaped = PQescapeIdentifier(pg_link, ZSTR_VAL(table), len);
if (escaped == NULL) {
- php_error_docref(NULL, E_NOTICE, "Failed to escape table name '%s'",
ZSTR_VAL(table));
+ php_error_docref(NULL, E_NOTICE, "Failed to escape table name '%pS'",
table);
return FAILURE;
}
smart_str_appends(querystr, escaped);
@@ -5560,7 +5560,7 @@ static inline zend_result build_tablename(smart_str *querystr, PGconn
*pg_link,
} else {
char *escaped = PQescapeIdentifier(pg_link, after_dot, len);
if (escaped == NULL) {
- php_error_docref(NULL, E_NOTICE, "Failed to escape table name '%s'",
ZSTR_VAL(table));
+ php_error_docref(NULL, E_NOTICE, "Failed to escape table name '%pS'",
table);
return FAILURE;
}
smart_str_appendc(querystr, '.');
@@ -5620,7 +5620,7 @@ PHP_PGSQL_API zend_result php_pgsql_insert(PGconn *pg_link, const zend_string
*t
if (opt & PGSQL_DML_ESCAPE) {
tmp = PQescapeIdentifier(pg_link, ZSTR_VAL(fld), ZSTR_LEN(fld));
if (tmp == NULL) {
- php_error_docref(NULL, E_NOTICE, "Failed to escape field '%s'",
ZSTR_VAL(fld));
+ php_error_docref(NULL, E_NOTICE, "Failed to escape field '%pS'", fld);
goto cleanup;
}
smart_str_appends(&querystr, tmp);
@@ -5643,7 +5643,7 @@ PHP_PGSQL_API zend_result php_pgsql_insert(PGconn *pg_link, const zend_string
*t
char *tmp = safe_emalloc(Z_STRLEN_P(val), 2, 1);
size_t new_len = PQescapeStringConn(pg_link, tmp, Z_STRVAL_P(val), Z_STRLEN_P(val),
&error);
if (error) {
- php_error_docref(NULL, E_NOTICE, "Failed to escape field '%s' value",
ZSTR_VAL(fld));
+ php_error_docref(NULL, E_NOTICE, "Failed to escape field '%pS' value",
fld);
efree(tmp);
goto cleanup;
}
@@ -5805,7 +5805,7 @@ static inline int build_assignment_string(PGconn *pg_link, smart_str
*querystr,
if (opt & PGSQL_DML_ESCAPE) {
char *tmp = PQescapeIdentifier(pg_link, ZSTR_VAL(fld), ZSTR_LEN(fld));
if (tmp == NULL) {
- php_error_docref(NULL, E_NOTICE, "Failed to escape field '%s'",
ZSTR_VAL(fld));
+ php_error_docref(NULL, E_NOTICE, "Failed to escape field '%pS'", fld);
return -1;
}
smart_str_appends(querystr, tmp);
@@ -5827,7 +5827,7 @@ static inline int build_assignment_string(PGconn *pg_link, smart_str
*querystr,
char *tmp = (char *)safe_emalloc(Z_STRLEN_P(val), 2, 1);
size_t new_len = PQescapeStringConn(pg_link, tmp, Z_STRVAL_P(val), Z_STRLEN_P(val),
&error);
if (error) {
- php_error_docref(NULL, E_NOTICE, "Failed to escape field '%s' value",
ZSTR_VAL(fld));
+ php_error_docref(NULL, E_NOTICE, "Failed to escape field '%pS' value",
fld);
efree(tmp);
return -1;
}
@@ -6171,7 +6171,7 @@ PHP_PGSQL_API zend_result php_pgsql_select(PGconn *pg_link, const zend_string
*t
php_pgsql_result2array(pg_result, ret_array, result_type);
ret = SUCCESS;
} else {
- php_error_docref(NULL, E_NOTICE, "Failed to execute '%s'",
ZSTR_VAL(querystr.s));
+ php_error_docref(NULL, E_NOTICE, "Failed to execute '%pS'", querystr.s);
}
PQclear(pg_result);