Skip to content

ext/opcache: unwrap reference wrappers in typed by-value returns#21973

Open
LamentXU123 wants to merge 2 commits intophp:PHP-8.4from
LamentXU123:bug-fix-21972
Open

ext/opcache: unwrap reference wrappers in typed by-value returns#21973
LamentXU123 wants to merge 2 commits intophp:PHP-8.4from
LamentXU123:bug-fix-21972

Conversation

@LamentXU123
Copy link
Copy Markdown
Contributor

@LamentXU123 LamentXU123 commented May 7, 2026

So there is a fast path to check if the types is already matched that caused the bug. I wrote this to copy the referenced value in ZEND_VERIFY_RETURN_TYPE before taking the fast path for already-matching return types.

Fixes #21972

Comment thread Zend/zend_vm_def.h
@bwoebi
Copy link
Copy Markdown
Member

bwoebi commented May 7, 2026

@LamentXU123 Can you please base this PR on PHP 8.4?

@LamentXU123 LamentXU123 marked this pull request as draft May 7, 2026 13:25
@LamentXU123 LamentXU123 changed the base branch from master to PHP-8.4 May 7, 2026 13:26
@LamentXU123 LamentXU123 marked this pull request as ready for review May 7, 2026 13:26
@LamentXU123
Copy link
Copy Markdown
Contributor Author

@LamentXU123 Can you please base this PR on PHP 8.4?

Done :)

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.

Corrupted variable type Argument #1 ($string) must be of type string, string given

2 participants