core icon indicating copy to clipboard operation
core copied to clipboard

"PHP Deprecated: ... "

Open emresaracoglu opened this issue 1 year ago • 4 comments

Hello,

I have recently seen the following error occur. I have updated the library with Composer but the same errors still occur. How can I solve it?

Thank you.

PHP 8.2

PHP Deprecated: Creation of dynamic property Longman\TelegramBot\Entities\ServerResponse::$ok is deprecated in /var/www/***/vendor/longman/telegram-bot/src/Entities/Entity.php on line 81; PHP message: PHP Deprecated: Creation of dynamic property Longman\TelegramBot\Entities\ServerResponse::$result is deprecated in /var/www/***/vendor/longman/telegram-bot/src/Entities/Entity.php on line 81; PHP message: PHP Deprecated: Creation of dynamic property Longman\TelegramBot\Entities\ServerResponse::$raw_data is deprecated in /var/www/***/vendor/longman/telegram-bot/src/Entities/Entity.php on line 81; PHP message: PHP Deprecated: Creation of dynamic property Longman\TelegramBot\Entities\ServerResponse::$bot_username is deprecated in /var/www/***/vendor/longman/telegram-bot/src/Entities/Entity.php on line 81" while reading response header from upstream, client: 23.88.105.37, server: example.com, request: "GET /wos/cron HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php7.4-fpm/web3.sock:", host: "example.com"

emresaracoglu avatar Apr 18 '24 19:04 emresaracoglu

Hello

As far as i'm aware PHP 8.2 isn't fully supported yet. please use php 8.1 if you can. This bug is known and worked on.

Hitmare avatar Apr 18 '24 19:04 Hitmare

If it is a known bug and a solution is sought, I may need to close the topic. Thank you for your response

emresaracoglu avatar Apr 18 '24 20:04 emresaracoglu

https://github.com/php-telegram-bot/core/blob/57a649cfcfe35883165c19942b460ea6b2dfd606/.github/workflows/tests.yaml#L19 looks to me like a lie :)

After https://github.com/php-telegram-bot/core/blob/develop/phpunit.xml.dist#L13

It should never silence errors in test suite IMO

Also, this is an easy fix - after removing the silencing. It can be fixed in a BC way by just adding the properties as expected by modern PHP

dereuromark avatar Apr 26 '24 14:04 dereuromark