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.
jsor approved these changes Aug 24, 2020
clue deleted the php8-closed branch
August 25, 2020 06:42
clue
mentioned this pull request
Merged
clue
mentioned this pull request
Merged