Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

执行 php bin/swoft -V 后出现很多错误提示 #1461

Open
nx04 opened this issue Jan 5, 2022 · 3 comments
Open

执行 php bin/swoft -V 后出现很多错误提示 #1461

nx04 opened this issue Jan 5, 2022 · 3 comments
Assignees
Labels

Comments

@nx04
Copy link

nx04 commented Jan 5, 2022

Q A
Bug report? yes
Feature request? no
Swoft version 2.0.11 (by php bin/swoft -V)
Swoole version 4.8.4 (by php --ri swoole)
PHP version 8.1.1 (by php -v)
Runtime environment CentOS Linux release 7.2.1511 (Core)

Describe the bug

执行 php bin/swoft -V 后出现很多错误提示,详细截图和描述如下。

Expected behavior

期望不要出现这么多错误信息

Screenshots

  • 第一张图片:

image

  • 第二张图片:

image

Details

Deprecated: Return type of Swoft\WebSocket\Server\Message\Message::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/hp/hp-swoft/vendor/swoft/websocket-server/src/Message/Message.php on line 156

Deprecated: Return type of Swoft\Event\Event::offsetGet($name) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/hp/hp-swoft/vendor/swoft/event/src/Event.php on line 323

Deprecated: Swoft\Event\Event implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /home/hp/hp-swoft/vendor/swoft/event/src/Event.php on line 26

Deprecated: Swoft\Server\Event\ServerStartEvent implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /home/hp/hp-swoft/vendor/swoft/server/src/Event/ServerStartEvent.php on line 21

Deprecated: Swoft\Server\Event\WorkerEvent implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /home/hp/hp-swoft/vendor/swoft/server/src/Event/WorkerEvent.php on line 20

Deprecated: Return type of Swoft\Http\Session\HttpSession::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/hp/hp-swoft/vendor/swoft/session/src/HttpSession.php on line 461

Deprecated: Return type of Swoft\Db\Eloquent\Model::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/hp/hp-swoft/vendor/swoft/db/src/Eloquent/Model.php on line 977

Deprecated: Return type of Swoft\Db\Eloquent\Model::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/hp/hp-swoft/vendor/swoft/db/src/Eloquent/Model.php on line 990

Deprecated: Return type of Swoft\Db\Eloquent\Model::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/hp/hp-swoft/vendor/swoft/db/src/Eloquent/Model.php on line 1004

Deprecated: Return type of Swoft\Db\Eloquent\Model::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/hp/hp-swoft/vendor/swoft/db/src/Eloquent/Model.php on line 1016

Deprecated: Return type of Swoft\Db\Eloquent\Model::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/hp/hp-swoft/vendor/swoft/db/src/Eloquent/Model.php on line 820

Deprecated: Return type of Swoft\Stdlib\Collection::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/hp/hp-swoft/vendor/swoft/stdlib/src/Collection.php on line 1982

PHP: 8.1.1, Swoft: 2.0.11, Swoole: 4.8.4

Fatal error: Uncaught ErrorException: Return type of Swoft\Stdlib\Fluent::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/hp/hp-swoft/vendor/swoft/stdlib/src/Fluent.php:127

Stack trace:
/home/hp/hp-swoft/vendor/swoft/error/src/DefaultErrorDispatcher.php(72): Swoft\Error\DefaultErrorDispatcher->handleError(8192, 'Return type of ...', '/home/hp/hp-swo...', 127)

{main}
thrown in /home/hp/hp-swoft/vendor/swoft/stdlib/src/Fluent.php on line 127

Provide minimal script to reproduce the issue

php bin/swoft -V
@inhere
Copy link
Member

inhere commented Jan 5, 2022

当前还没对 php 8.1 做兼容处理的

@nx04
Copy link
Author

nx04 commented Jan 5, 2022

@inhere 好的,明白了,谢谢你,期待能兼容一下php8.1

@kai890707
Copy link

kai890707 commented Sep 15, 2023

目前檔案上Docker佈署方案的php版本依舊只有7.2,希望能建立7.4以上的版本範例。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants