Ratchet icon indicating copy to clipboard operation
Ratchet copied to clipboard

Support for PHP 8.0, PHP 8.1 and PHP 8.2

Open SimonFrings opened this issue 1 year ago • 10 comments

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:

SimonFrings avatar Mar 15 '23 14:03 SimonFrings

Would much appreciate this being fixed.

CoderJoeW avatar Mar 17 '23 18:03 CoderJoeW

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

agarzon-orangerine avatar Mar 23 '23 13:03 agarzon-orangerine

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. 💪

clue avatar Mar 23 '23 15:03 clue

hello guys, any progress? Thank you.

thorewi avatar Apr 26 '23 08:04 thorewi

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

pgavanuatu avatar May 28 '23 21:05 pgavanuatu

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

leshiq avatar Dec 14 '23 16:12 leshiq

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.

agarzon-orangerine avatar Dec 14 '23 16:12 agarzon-orangerine

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.

seb303 avatar Dec 14 '23 18:12 seb303

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 avatar Dec 31 '23 13:12 dezsi-istvan

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

dezsi-istvan avatar Dec 31 '23 13:12 dezsi-istvan