[php-src] master: tree: use zend_string API when possible (#24330)

From: Date: Wed, 14 Oct 2026 21:40:15 +0000
Subject: [php-src] master: tree: use zend_string API when possible (#24330)
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-142291@lists.php.net to get a copy of this message
Author: Gina Peter Banyard (Girgias) Committer: GitHub (web-flow) Pusher: Girgias Date: 2026-10-14T22:40:12+01:00 Commit: https://github.com/php/php-src/commit/1439349419cf98775a0638a2f1b047748663734a Raw diff: https://github.com/php/php-src/commit/1439349419cf98775a0638a2f1b047748663734a.diff tree: use zend_string API when possible (#24330) Changed paths: M Zend/zend_compile.c M ext/pdo_firebird/firebird_statement.c M ext/soap/php_encoding.c Diff: diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 504cc96c21d9..032105019a27 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -304,9 +304,7 @@ static zend_always_inline uint8_t zend_lookup_builtin_type_by_name(const zend_st const builtin_type_info *info = &builtin_types[0]; for (; info->name; ++info) { - if (ZSTR_LEN(name) == info->name_len - && zend_binary_strcasecmp(ZSTR_VAL(name), ZSTR_LEN(name), info->name, info->name_len) == 0 - ) { + if (zend_string_equals_cstr_ci(name, info->name, info->name_len)) { return info->type; } } diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c index c508c34305ca..6f6a4fa8610f 100644 --- a/ext/pdo_firebird/firebird_statement.c +++ b/ext/pdo_firebird/firebird_statement.c @@ -766,9 +766,9 @@ static int pdo_firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param *(FB_BOOLEAN*)var->sqldata = (dval != 0) ? FB_TRUE : FB_FALSE; break; default: - if (!zend_binary_strncasecmp(Z_STRVAL_P(parameter), Z_STRLEN_P(parameter), "true", 4, 4)) { + if (zend_string_equals_literal_ci(Z_STR_P(parameter), "true")) { *(FB_BOOLEAN*)var->sqldata = FB_TRUE; - } else if (!zend_binary_strncasecmp(Z_STRVAL_P(parameter), Z_STRLEN_P(parameter), "false", 5, 5)) { + } else if (zend_string_equals_literal_ci(Z_STR_P(parameter), "false")) { *(FB_BOOLEAN*)var->sqldata = FB_FALSE; } else { const char *msg = "Cannot convert string to boolean"; diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 73589025ccc6..5d52ba7d7798 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -442,11 +442,7 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml ZEND_HASH_FOREACH_STR_KEY_VAL(SOAP_GLOBAL(class_map), type_name, tmp) { ZVAL_DEREF(tmp); - if (Z_TYPE_P(tmp) == IS_STRING && - ZSTR_LEN(ce->name) == Z_STRLEN_P(tmp) && - zend_binary_strncasecmp(ZSTR_VAL(ce->name), ZSTR_LEN(ce->name), Z_STRVAL_P(tmp), ZSTR_LEN(ce->name), ZSTR_LEN(ce->name)) == 0 && - type_name) { - + if (Z_TYPE_P(tmp) == IS_STRING && type_name && zend_string_equals_ci(ce->name, Z_STR_P(tmp))) { /* TODO: namespace isn't stored */ encodePtr enc = NULL; if (SOAP_GLOBAL(sdl)) {

« previous php.cvs (#142291) next »