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

Deprecated Message Shown by PHP #848

Closed hsnfirdaus closed 2 years ago

hsnfirdaus commented 2 years ago

Configuration

Describe the bug

Getting this deprecated message:

Deprecated:  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 /home/htdocs/v2/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/Util/ArrayObject.php on line 52

Deprecated:  Return type of Phpfastcache\Drivers\Files\Item::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/htdocs/v2/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/Core/Item/ItemExtendedTrait.php on line 339
github-actions[bot] commented 2 years ago

Hello curious contributor ! Since it seems to be your first contribution, make sure that you've been:

Geolim4 commented 2 years ago

Hello,

I have pushed a fix for Phpfastcache 8.1 (with PHP 8.1), but I strongly encourage you to upgrade to Phpfastcache 9.0.

I won't release a new version immediately so you might want to use "v8.x-dev" channel on composer.

Cheers, Georges.

Awilum commented 2 years ago

@Geolim4 Unfortunately this issue still reproduced, please add #[\ReturnTypeWillChange] https://github.com/PHPSocialNetwork/phpfastcache/issues/846#issuecomment-1004766170

Awilum commented 2 years ago

@Geolim4 please check this https://php.watch/versions/8.1/ReturnTypeWillChange https://php.watch/versions/8.1/internal-method-return-types#ReturnTypeWillChange

php 7.4 is still most popular version

Geolim4 commented 2 years ago

I just pushed fixes today, see commit above !

Awilum commented 2 years ago

Thanks, I see. Waiting for new release with this fixes

Geolim4 commented 2 years ago

I won't make a new release soon, use "v8.x-dev" meanwhile.

huqedato commented 2 years ago

Sadly, the issue still persisting with Php v8.1 and PhpFastCache v7

<br />
<b>Deprecated</b>:  Return type of Phpfastcache\Util\ArrayObject::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 <b>/var/www/server/public_html/includes/vendor/cache/lib/Phpfastcache/Util/ArrayObject.php</b> on line <b>106</b><br />
<br />
<b>Deprecated</b>:  Return type of Phpfastcache\Util\ArrayObject::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 <b>/var/www/server/public_html/includes/vendor/cache/lib/Phpfastcache/Util/ArrayObject.php</b> on line <b>115</b><br />
<br />
<b>Deprecated</b>:  Return type of Phpfastcache\Util\ArrayObject::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 <b>/var/www/server/public_html/includes/vendor/cache/lib/Phpfastcache/Util/ArrayObject.php</b> on line <b>130</b><br />
<br />
<b>Deprecated</b>:  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 <b>/var/www/server/public_html/includes/vendor/cache/lib/Phpfastcache/Util/ArrayObject.php</b> on line <b>48</b><br />
<br />
<b>Deprecated</b>:  Return type of Phpfastcache\Util\ArrayObject::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in <b>/var/www/server/public_html/includes/vendor/cache/lib/Phpfastcache/Util/ArrayObject.php</b> on line <b>56</b><br />
<br />
<b>Deprecated</b>:  Return type of Phpfastcache\Util\ArrayObject::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in <b>/var/www/server/public_html/includes/vendor/cache/lib/Phpfastcache/Util/ArrayObject.php</b> on line <b>80</b><br />
<br />
<b>Deprecated</b>:  Return type of Phpfastcache\Drivers\Redis\Item::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in <b>/var/www/server/public_html/includes/vendor/cache/lib/Phpfastcache/Core/Item/ItemExtendedTrait.php</b> on line <b>438</b><br />
<br />
Geolim4 commented 2 years ago

Sadly, the issue still persisting with Php v8.1 and PhpFastCache v7

<br />
<b>Deprecated</b>:  Return type of Phpfastcache\Util\ArrayObject::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 <b>/var/www/server/public_html/includes/vendor/cache/lib/Phpfastcache/Util/ArrayObject.php</b> on line <b>106</b><br />
<br />
<b>Deprecated</b>:  Return type of Phpfastcache\Util\ArrayObject::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 <b>/var/www/server/public_html/includes/vendor/cache/lib/Phpfastcache/Util/ArrayObject.php</b> on line <b>115</b><br />
<br />
<b>Deprecated</b>:  Return type of Phpfastcache\Util\ArrayObject::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 <b>/var/www/server/public_html/includes/vendor/cache/lib/Phpfastcache/Util/ArrayObject.php</b> on line <b>130</b><br />
<br />
<b>Deprecated</b>:  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 <b>/var/www/server/public_html/includes/vendor/cache/lib/Phpfastcache/Util/ArrayObject.php</b> on line <b>48</b><br />
<br />
<b>Deprecated</b>:  Return type of Phpfastcache\Util\ArrayObject::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in <b>/var/www/server/public_html/includes/vendor/cache/lib/Phpfastcache/Util/ArrayObject.php</b> on line <b>56</b><br />
<br />
<b>Deprecated</b>:  Return type of Phpfastcache\Util\ArrayObject::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in <b>/var/www/server/public_html/includes/vendor/cache/lib/Phpfastcache/Util/ArrayObject.php</b> on line <b>80</b><br />
<br />
<b>Deprecated</b>:  Return type of Phpfastcache\Drivers\Redis\Item::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in <b>/var/www/server/public_html/includes/vendor/cache/lib/Phpfastcache/Core/Item/ItemExtendedTrait.php</b> on line <b>438</b><br />
<br />

That's normal, v7 is no longer supported, please upgrade at least to v8.1.

Read the Wiki

apoca commented 1 year ago

@Geolim4 weird but I have PHP 8.1 and phpfastcahe 8.1.X and I got the same issues above, lots of deprecated functions in PHP8.1 as an example: Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated

Geolim4 commented 1 year ago

mb_strlen

Which version are you using ?

apoca commented 1 year ago

I've solved. My bad... I'm using 8.1.4 and I've cleaned my sentry plataforma for this project and I didn't catch anymore any deprecated function. Thanks.