Closed spideyfusion closed 3 years ago
I originally thought about using the socket_import_stream function to convert the stream resource into a socket resource, but unfortunately, the function doesn't work in combination with SSL:
PHP Warning: socket_import_stream(): Cannot represent a stream of type tcp_socket/ssl as a Socket Descriptor
Huh, that's annoying that socket_import_stream()
won't handle SSL. Merging this as the best/easy fix we have. Thanks for the work/submission.
@fennb Thanks a lot for a prompt response. Could you please create a new tagged release that contains this fix?
@spideyfusion done!
As a favour, I don't supposed you could test that this PR is safe/works? If so, I will merge it in too: https://github.com/fennb/phirehose/pull/125
@fennb I tested the changes and left a review on the PR.
This fix addresses the following breaking change introduced in PHP 8.0:
I originally thought about using the socket_import_stream function to convert the stream resource into a socket resource, but unfortunately, the function doesn't work in combination with SSL:
With this simple change, the last socket-related error that occurred will be retrieved from PHP's own global internal store, as seen here. This function behavior dates all the way back to PHP 5.x, so the change is pretty safe to apply unconditionally.
The rest of the codebase works fine under PHP 8.0.