-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Description
Symfony version(s) affected: 4.4+
Description
Using the native HTTP client on php 7.3.22 and 7.4.10 produces the following error:
fopen(http://some/url): Failed to open stream: Failed to parse address "0"
How to reproduce
Run the test suite on php 7.3.22 or 7.4.10.
Possible Solution
Either:
- Change the default value for
bindtoin the contract from0to0:0. - Implement a workaround that removes
bindtofrom the stream context is it has been set to0. - Implement a workaround that adds
:0is the port is missing. - Fix php and restore the previous behavior.
Additional context
The problem seems to be that fopen fails if we provide an address without a port as bindto inside the stream context. This is unfortunate because HttpClient uses 0 as a default value, which means that if we don't explicitly set a value here, the request will fail. The default value is provided by the contract's ClientInterface. Changing it to 0:0 makes the tests pass again.
This change has been introduced with php 7.3.22/7.4.10. Running the test suite on php 7.3.21 or 7.4.9 works fine.
YetiCGN