walkor / phpsocket.io

A server side alternative implementation of socket.io in PHP based on workerman.
2.3k stars 508 forks source link

Fixed Declaration of RFC6455::input(), RFC6455::encode() and RFC6455::decode() compatible issue #287

Closed binemmanuel closed 1 year ago

binemmanuel commented 1 year ago

Compatibility issues on PHP 8.1.13 fixed

walkor commented 1 year ago

Thanks

marcosmarcolin commented 1 year ago

This change makes it incompatible with versions smaller than 8.0, I believe that is not your intention @walkor.

ERROR: E_PARSE "syntax error, unexpected '|', expecting ';' or '{' in /var/www/vendor/workerman/phpsocket.io/src/Engine/Protocols/WebSocket/RFC6455.php on line 47"

Where:

public static function input(string $buffer, ConnectionInterface $connection): bool|int

Union Types is functional in versions >= 8.0.

After removing this, there will be other problems:

Perhaps this should be revised?

If you have this break to be compatible with => 8.0, could a version 2 be released?

The same way it was done with workerman/workerman.

Thank you for your attention, hug.

marcosmarcolin commented 1 year ago

Thanks @walkor.