Skip to content

Conversation

@Chikashi-Kato
Copy link
Contributor

E_WARNING: Undefined variable $http_response_header is reported when file_get_contents fails to fetch the specified $url. This seems to happen because HTTP Wrapper doesn't set $http_response_header when it fails.

Since PHP 8 accesses to undefined variables are reported as E_WARNING, this became more visible and noisier.

This PR avoids the warning by using a coalescing operator.

@douglasmiller douglasmiller added the V4 v2021-02-25 Client label Jul 18, 2025
@douglasmiller douglasmiller force-pushed the avoid-undefined-variable-warning branch from 9d74073 to 56a00d0 Compare July 18, 2025 17:07
@douglasmiller douglasmiller merged commit 422b448 into recurly:v3-v2021-02-25 Jul 18, 2025
7 checks passed
recurly-integrations pushed a commit that referenced this pull request Jul 18, 2025
[Full Changelog](4.62.0...4.62.1)

**Merged Pull Requests**

- Correct implicit null parameter types which are deprecated in PHP 8.4 [#832](#832) ([signe](https://github.com/signe))
- PHP8: Avoids a warning about the undefined variable in the case file_get_contents fails [#822](#822) ([Chikashi-Kato](https://github.com/Chikashi-Kato))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

V4 v2021-02-25 Client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants