ratchetphp / Ratchet

Asynchronous WebSocket server
http://socketo.me
MIT License
6.25k stars 733 forks source link

Support for PHP 8.0, PHP 8.1 and PHP 8.2 #1003

Open SimonFrings opened 1 year ago

SimonFrings commented 1 year ago

I am currently investing some time into Ratchet and want to test the project against PHP 8.0+. Inspired by https://github.com/ratchetphp/Ratchet/pull/923 by @WyriHaximus, I wanted to try it out myself. Before running the test suite with the PHP 8 versions, I first have to update PHPUnit to the latest version (at least v8, maybe v9 as a first step) and make it work across the current supported PHP versions for this project (PHP 5.4 - PHP 7.4). I did the same thing for ReactPHP a while ago (e.g. https://github.com/reactphp/http/pull/364), so I already know my ways around.

Will keep you posted :+1:

CoderJoeW commented 1 year ago

Would much appreciate this being fixed.

agarzon-orangerine commented 1 year ago

Hard to believe PHP 8.x is not supported yet. 😣

clue commented 1 year ago

To add some context: Ratchet already has limited support for PHP 8+ and many people use this in production, but it may report some minor deprecations as mentioned in the linked tickets. I've started looking into this together with @SimonFrings to bring full support for PHP 8+, update the test environment, and fix any warnings. Ratchet could definitely use some love and we're still working on ways to ensure this will be addressed in the future!

If you also want to see this ticket solved, you can upvote or help by sponsoring our development. ❤️ We'll work out a longer-term plan to ensure ongoing development of Ratchet, but this is probably out of scope for this ticket at the moment (see #921?). In the meantime, I'll hide offtopic comments here to allow us to focus and getting things done. 💪

thorewi commented 1 year ago

hello guys, any progress? Thank you.

pgavanuatu commented 1 year ago

Hi, First of all : congrats on the great work on this project. I need to prepare my code for php8.2 and as you already know... last version of rachet is not working because PHP is becoming a strict language and we need now to declare every Variables.

Is there a timeline for your fixes for php8.2 ? If it is one month, I fix it localy with #[AllowDynamicProperties] and wait for your solution

if it is more, I will need to change to something else...

Thanks a lot for your help Regards Philippe

leshiq commented 9 months ago

Really hope for the new patch to solve the 8.2 depricated issue!

agarzon-orangerine commented 9 months ago

Really hope for the new patch to solve the 8.2 depricated issue!

Last release was 2 years ago, and now PHP 8.3 was officially released.

So, I wouldn't count on it.

seb303 commented 9 months ago

Really hope for the new patch to solve the 8.2 depricated issue!

We're using error_reporting(E_ALL ^ E_DEPRECATED); as a workaround where we're using Rachet ... not ideal as it may hide other depreciations which we would want to be aware of.

dezsi-istvan commented 9 months ago

A PHP Error was encountered

Severity: 8192 Message: Creation of dynamic property Ratchet\Server\IoConnection::$remoteAddress is deprecated Filename: /app/vendor/cboden/ratchet/src/Ratchet/Server/IoServer.php Line Number: 87

Backtrace:

File: /app/vendor/cboden/ratchet/src/Ratchet/Server/IoServer.php
    Line: 87
    Function: _error_handler

File: /app/vendor/evenement/evenement/src/EventEmitterTrait.php
    Line: 143
    Function: handleConnect

File: /app/vendor/react/socket/src/Server.php
    Line: 88
    Function: emit

File: /app/vendor/evenement/evenement/src/EventEmitterTrait.php
    Line: 143
dezsi-istvan commented 9 months ago

Message: Creation of dynamic property React\Socket\Connection::$decor is deprecated Filename: /app/vendor/cboden/ratchet/src/Ratchet/Server/IoServer.php Line Number: 83

Severity: 8192 Message: Creation of dynamic property Ratchet\Server\IoConnection::$resourceId is deprecated Filename: /app/vendor/cboden/ratchet/src/Ratchet/Server/IoServer.php Line Number: 84

Severity: 8192 Message: Creation of dynamic property Ratchet\Server\IoConnection::$remoteAddress is deprecated Filename: /app/vendor/cboden/ratchet/src/Ratchet/Server/IoServer.php Line Number: 87

Severity: 8192 Message: Creation of dynamic property Ratchet\Server\IoConnection::$httpHeadersReceived is deprecated Filename: /app/vendor/cboden/ratchet/src/Ratchet/Http/HttpServer.php Line Number: 33

Severity: 8192 Message: Creation of dynamic property Ratchet\Server\IoConnection::$httpBuffer is deprecated Filename: /app/vendor/cboden/ratchet/src/Ratchet/Http/HttpRequestParser.php Line Number: 30

Severity: 8192 Message: Creation of dynamic property Ratchet\Server\IoConnection::$httpRequest is deprecated Filename: /app/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServer.php Line Number: 112

Severity: 8192 Message: Creation of dynamic property Ratchet\Server\IoConnection::$WebSocket is deprecated Filename: /app/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServer.php Line Number: 114