PHPSocialNetwork / phpfastcache

A high-performance backend cache system. It is intended for use in speeding up dynamic web applications by alleviating database load. Well implemented, it can drops the database load to almost nothing, yielding faster page load times for users, better resource utilization. It is simple yet powerful.
https://www.phpfastcache.com
MIT License
2.36k stars 452 forks source link

php 8.1 incompatibility: During inheritance of Iterator: Uncaught ErrorException: #849

Closed mbiebl closed 2 years ago

mbiebl commented 2 years ago

Running php 8.1.2 with phpfastcache 8.1.0, I get the following exception

<br />
<b>Fatal error</b>:  During inheritance of Iterator: Uncaught ErrorException: Return type of Phpfastcache\Util\ArrayObject::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in www\vendor\phpfastcache\phpfastcache\lib\Phpfastcache\Util\ArrayObject.php:52
Stack trace:
#0 www\vendor\phpfastcache\phpfastcache\lib\Phpfastcache\Util\ArrayObject.php(27): exception_error_handler()
#1 www\vendor\composer\ClassLoader.php(571): include('...')
#2 www\vendor\composer\ClassLoader.php(428): Composer\Autoload\includeFile()
#3 www\vendor\phpfastcache\phpfastcache\lib\Phpfastcache\Config\ConfigurationOption.php(30): Composer\Autoload\ClassLoader-&gt;loadClass()
#4 www\vendor\composer\ClassLoader.php(571): include('...')
#5 www\vendor\composer\ClassLoader.php(428): Composer\Autoload\includeFile()
#6 www\vendor\phpfastcache\phpfastcache\lib\Phpfastcache\Config\Config.php(25): Composer\Autoload\ClassLoader-&gt;loadClass()
#7 www\vendor\composer\ClassLoader.php(571): include('...')
#8 www\vendor\composer\ClassLoader.php(428): Composer\Autoload\includeFile()
#9 www\wwwroot\server.php(101): Composer\Autoload\ClassLoader-&gt;loadClass()
#10 {main} in <b>www\vendor\phpfastcache\phpfastcache\lib\Phpfastcache\Util\ArrayObject.php</b> on line <b>27</b><br />
mbiebl commented 2 years ago

Seems this has been fixed by #848.

Would be awesome to have a new release 8.1.1 with this fix included. Unfortunately I can't upgrade to phpfastcache v9 just yet.