Skip to content

Conversation

@joehoyle
Copy link
Collaborator

@joehoyle joehoyle commented Dec 1, 2023

No description provided.

@danog
Copy link
Collaborator

danog commented Dec 1, 2023

Super strange that this is passing, it's very clear that the type should be a zend_string, not a C string...
https://github.com/php/php-src/blob/PHP-8.2/Zend/zend_compile.c#L6327

@joehoyle
Copy link
Collaborator Author

joehoyle commented Dec 1, 2023

I think they are converted to ZendStr when copied from ZendFunctionEntry maybe? Looking at the macros for registering functions return types for internal functions, I can't see anything that expects a ZendStr there (ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO -> ZEND_TYPE_INIT_CLASS)

@danog
Copy link
Collaborator

danog commented Dec 1, 2023

Ahh there's another _ZEND_TYPE_LITERAL_NAME_BIT flag, used to signify that type.ptr is not a zend_string* but a const char*

@joehoyle
Copy link
Collaborator Author

joehoyle commented Dec 1, 2023

Ahhh! Nice find :D

@danog
Copy link
Collaborator

danog commented Dec 1, 2023

But we're using _ZEND_TYPE_NAME_BIT, not _ZEND_TYPE_LITERAL_NAME_BIT...

@joehoyle
Copy link
Collaborator Author

joehoyle commented Dec 1, 2023

I think this might be different across PHP versions.. or something. IN PHP 8.3, there is:

/* Only one of these bits may be set. */
#define _ZEND_TYPE_NAME_BIT (1u << 24)
// Used to signify that type.ptr is not a `zend_string*` but a `const char*`,
#define _ZEND_TYPE_LITERAL_NAME_BIT (1u << 23)

whereas PHP 8.0:

#define _ZEND_TYPE_NAME_BIT (1u << 23)

@danog danog merged commit 3dcce49 into revert-293-revert-121-feat-integration-tests Dec 7, 2023
@Xenira Xenira deleted the revert-ctr-test branch July 1, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants