The previous code works just fine on PHP 7 and older. PHP 8 adds
stricter type checks for closed socket resources, so the underlying
function now throws a TypeError. This can be avoided by first checking
if the socket resource is still valid (not closed). This works across
all PHP versions and also helps with avoiding some uneeded error
suppression operators.
This means this component now supports PHP 8 just fine :tada:
This PR does not currently include PHP 8 in the Travis test matrix. PHP is scheduled to be released in November, I'll file a follow-up PR once it's available for installation on Travis.
The previous code works just fine on PHP 7 and older. PHP 8 adds stricter type checks for closed socket resources, so the underlying function now throws a
TypeError
. This can be avoided by first checking if the socket resource is still valid (not closed). This works across all PHP versions and also helps with avoiding some uneeded error suppression operators.This means this component now supports PHP 8 just fine :tada:
This PR does not currently include PHP 8 in the Travis test matrix. PHP is scheduled to be released in November, I'll file a follow-up PR once it's available for installation on Travis.
Builds on top of #243 and #244