Skip to content

Interned strings are not flagged as IS_STR_VALID_UTF8 #24449

Closed

Description

@rr-it

Description

Interned strings were flagged as IS_STR_VALID_UTF8 in general - introduced by 64127b6

php-src/Zend/zend_string.c

Lines 194 to 198 in 64127b6

static zend_string* ZEND_FASTCALL zend_init_string_for_interning(zend_string *str, bool persistent) {
uint32_t flags = 0;
if (ZSTR_IS_VALID_UTF8(str)) {
flags = IS_STR_VALID_UTF8;
}

Later on in the PHP 8.3.0 development cycle this feature was removed - without any mentioning in commit message - by 99b8614

php-src/Zend/zend_string.c

Lines 194 to 196 in 99b8614

static zend_string* ZEND_FASTCALL zend_init_string_for_interning(zend_string *str, bool persistent)
{
uint32_t flags = ZSTR_GET_COPYABLE_CONCAT_PROPERTIES(str);

static inline uint32_t ZSTR_GET_COPYABLE_CONCAT_PROPERTIES(const zend_string *s) {
return GC_FLAGS(s) & ZSTR_COPYABLE_CONCAT_PROPERTIES;
}

Shall this be reverted?

Also see #24380

PHP Version

Introduced and removed in PHP 8.3.0 early development.

Operating System

No response

Activity

  1. rr-it commented on Oct 19, 2026

    @rr-it
    Author

    Actually it was also only copying the already existant or non-existant UTF-8 flag state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions