flightphp / core

An extensible micro-framework for PHP
https://docs.flightphp.com
MIT License
2.63k stars 407 forks source link

Issue while updated to PHP 8.1 #459

Closed premento closed 2 years ago

premento commented 2 years ago

PHP message: PHP Fatal error: During inheritance of ArrayAccess: Uncaught ErrorException: Return type of flight\util\Collection::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 **/vendor/mikecao/flight/flight/util/Collection.php:106

Stack trace:

0 **/vendor/mikecao/flight/flight/util/Collection.php(19): flight\Engine->handleError()

1 **/vendor/mikecao/flight/flight/core/Loader.php(194): require('...')

2 **/vendor/mikecao/flight/flight/net/Request.php(147): flight\core\Loader::loadClass()

3 **/vendor/mikecao/flight/flight/core/Loader.php(125): flight\net\Request->__construct()

4 **/vendor/mikecao/flight/flight/core/Loader.php(81): flight\core\Loader->newIns"

magikstm commented 2 years ago

Which version are you using?

premento commented 2 years ago

PHP Version 8.1 mikecao/flight v1.3.9

Should I use v2.0.1 for solving this?

magikstm commented 2 years ago

I suggest trying it.

Version 2.0.1 was released to add PHP 8.0-8.1 compatibility.

premento commented 2 years ago

@magikstm Yes, now its working fine. Thank you.