Skip to content

Zend: add test for reading $http_response_header without explicit assignment which triggers deprecation warning#21633

Merged
Girgias merged 4 commits intophp:masterfrom
LamentXU123:add-tests
Apr 6, 2026
Merged

Zend: add test for reading $http_response_header without explicit assignment which triggers deprecation warning#21633
Girgias merged 4 commits intophp:masterfrom
LamentXU123:add-tests

Conversation

@LamentXU123
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

This should be with all the other tests in ext/standard/tests/http/. But does this actually increase code coverage? There are a few tests already and I wasn't sure if I was hitting this code path.

@Girgias
Copy link
Copy Markdown
Member

Girgias commented Apr 6, 2026

So the current line is indeed not covered by a unit test: https://app.codecov.io/github/php/php-src/blob/master/Zend%2Fzend_compile.c#L2978

@LamentXU123
Copy link
Copy Markdown
Contributor Author

LamentXU123 commented Apr 6, 2026

Weird. It is touching https://github.com/php/php-src/blob/master/Zend/zend_compile.c#L2931 instead of https://github.com/php/php-src/blob/master/Zend/zend_compile.c#L2979. Let me fix this.

@LamentXU123
Copy link
Copy Markdown
Contributor Author

Fine, the new test should work
In original test cases deprecation is thrown directly in zend_try_compile_cv, this PR introduce a func that fails zend_try_compile_cv and therefore touch the other deprecation logic.

@LamentXU123 LamentXU123 requested a review from Girgias April 6, 2026 13:51
Copy link
Copy Markdown
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

Incredibly clever test :)

@Girgias Girgias merged commit 2568744 into php:master Apr 6, 2026
19 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.

3 participants