Skip to content

Conversation

derickr
Copy link
Member

@derickr derickr commented Aug 24, 2025

Per request/suggestion from @sebastianbergmann

@arnaud-lb
Copy link
Member

I think it would be fine to just expose ZEND_VM_KIND as a string (HYBRID|TAILCALL|CALL), and to remove the ZEND_VM_KIND_ constants.

@kallesommernielsen
Copy link

I think it would be fine to just expose ZEND_VM_KIND as a string (HYBRID|TAILCALL|CALL), and to remove the ZEND_VM_KIND_ constants.

While I tend to agree with this because it's a bit of a niche use case. The current proposal does make for a nicer API for the end user given we didn't go as far as to make it an enumeration.

TL;DR I think the current PR is just fine for what we are looking to achieve

@TimWolla
Copy link
Member

The current proposal does make for a nicer API for the end user given we didn't go as far as to make it an enumeration.

I disagree. The other constants are not really properly discoverable either and with the "random integer value" they are just fancy strings. So we might as well use a string directly.

Copy link
Member

@edorian edorian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No RM objections for this to go into 8.5 if desired.

No technical review performed.

@derickr
Copy link
Member Author

derickr commented Aug 25, 2025

I am happy to expose it as a string, but then we can't use the stub like this, as the strings aren't part of PHP yet. Will have a look at this again then.

@derickr derickr force-pushed the add-zend-vm-kind-constant branch from e25e800 to cec179b Compare August 25, 2025 12:30
@derickr derickr requested a review from dstogov as a code owner August 25, 2025 12:30
@derickr derickr force-pushed the add-zend-vm-kind-constant branch from cec179b to b28de03 Compare August 25, 2025 23:30
@derickr derickr force-pushed the add-zend-vm-kind-constant branch from fb4e2ec to 439a3ab Compare August 26, 2025 08:20
@derickr derickr changed the title Add ZEND_VM_* constants Add ZEND_VM_KIND constant Aug 26, 2025
@derickr derickr requested a review from TimWolla August 26, 2025 08:20
@derickr derickr force-pushed the add-zend-vm-kind-constant branch from e210d60 to 9303bee Compare August 26, 2025 08:27
Copy link
Member

@arnaud-lb arnaud-lb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this breaks zend_vm_gen.php as the script defines ZEND_VM_KIND too. I suggest renaming ZEND_VM_KIND to ZEND_VM_MAIN_KIND or ZEND_VM_GEN_KIND in that script.

Looks good to me otherwise!

@derickr derickr requested review from TimWolla and arnaud-lb August 26, 2025 09:39
@derickr derickr merged commit 7382895 into php:master Aug 26, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants