framework icon indicating copy to clipboard operation
framework copied to clipboard

PHP8.1 Fatal error

Open devhaozi opened this issue 2 years ago • 1 comments

今天测试了v6.0.13在PHP8.1下的表现,很遗憾,依旧一堆报错,部分截取如下:

PHP Fatal error: During inheritance of ArrayAccess: Uncaught think\exception\ErrorException: Return type of think\Request::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 /www/panel/vendor/topthink/framework/src/think/Request.php:2156 Stack trace: #0 /www/panel/vendor/topthink/framework/src/think/Request.php(23): think\initializer\Error->appError() #1 /www/panel/vendor/composer/ClassLoader.php(571): include('...') #2 /www/panel/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile() #3 /www/panel/app/Request.php(5): Composer\Autoload\ClassLoader->loadClass() #4 /www/panel/vendor/composer/ClassLoader.php(571): include('...') #5 /www/panel/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile() #6 [internal function]: Composer\Autoload\ClassLoader->loadClass() #7 /www/panel/vendor/topthink/framework/src/think/Container.php(375): ReflectionClass->__construct() #8 /www/panel/vendor/topthink/framework/src/think/Container.php(251): think\Container->invokeClass() #9 /www/panel/vendor/topthink/framework/src/think/Console.php(156): think\Container->make() #10 /www/panel/vendor/topthink/framework/src/think/Console.php(112): think\Console->makeRequest() #11 /www/panel/vendor/topthink/framework/src/think/Console.php(94): think\Console->initialize() #12 [internal function]: think\Console->__construct() #13 /www/panel/vendor/topthink/framework/src/think/Container.php(394): ReflectionClass->newInstanceArgs() #14 /www/panel/vendor/topthink/framework/src/think/Container.php(251): think\Container->invokeClass() #15 /www/panel/vendor/topthink/framework/src/think/Container.php(130): think\Container->make() #16 /www/panel/vendor/topthink/framework/src/think/Container.php(510): think\Container->get() #17 /www/panel/think(10): think\Container->__get() #18 {main} in /www/panel/vendor/topthink/framework/src/think/Request.php on line 23

`PHP Deprecated: Return type of think\Container::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/panel/vendor/topthink/framework/src/think/Container.php on line 523

Deprecated: Return type of think\Container::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/panel/vendor/topthink/framework/src/think/Container.php on line 523 PHP Deprecated: Return type of think\Container::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 /www/panel/vendor/topthink/framework/src/think/Container.php on line 528

Deprecated: Return type of think\Container::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 /www/panel/vendor/topthink/framework/src/think/Container.php on line 528 PHP Deprecated: Return type of think\Container::offsetSet($key, $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 /www/panel/vendor/topthink/framework/src/think/Container.php on line 533

Deprecated: Return type of think\Container::offsetSet($key, $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 /www/panel/vendor/topthink/framework/src/think/Container.php on line 533 PHP Deprecated: Return type of think\Container::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/panel/vendor/topthink/framework/src/think/Container.php on line 538

Deprecated: Return type of think\Container::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/panel/vendor/topthink/framework/src/think/Container.php on line 538 PHP Deprecated: Return type of think\Container::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/panel/vendor/topthink/framework/src/think/Container.php on line 550

Deprecated: Return type of think\Container::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/panel/vendor/topthink/framework/src/think/Container.php on line 550 PHP Deprecated: Return type of think\Container::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/panel/vendor/topthink/framework/src/think/Container.php on line 544

Deprecated: Return type of think\Container::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/panel/vendor/topthink/framework/src/think/Container.php on line 544 PHP Deprecated: Return type of think\Env::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 /www/panel/vendor/topthink/framework/src/think/Env.php on line 177

Deprecated: Return type of think\Env::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 /www/panel/vendor/topthink/framework/src/think/Env.php on line 177 PHP Deprecated: Return type of think\Env::offsetUnset($name) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/panel/vendor/topthink/framework/src/think/Env.php on line 172

Deprecated: Return type of think\Env::offsetUnset($name) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /www/panel/vendor/topthink/framework/src/think/Env.php on line 172`

devhaozi avatar Jul 31 '22 20:07 devhaozi

这是8.1版本PHP造成的不兼容,8.1增加了接口参数返回值,以前没

season886 avatar Aug 13 '22 03:08 season886