# Slim in PHP 8.1 shows strange errors

**URL:** <https://discourse.slimframework.com/t/slim-in-php-8-1-shows-strange-errors/5089>\
**Category:** Questions\
**Created:** [January 25, 2022, 2:13pm UTC](https://discourse.slimframework.com/t/slim-in-php-8-1-shows-strange-errors/5089 "2022-01-25T14:13:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![taylorren](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/taylorren/32/1317_2.png) [@taylorren](https://discourse.slimframework.com/u/taylorren)\
**Post date:** [January 25, 2022, 2:13pm UTC](https://discourse.slimframework.com/t/slim-in-php-8-1-shows-strange-errors/5089/1 "2022-01-25T14:13:22Z")

</div>

I have been using Slim PHP framework to provide my API service ([https://api.rsywx.com](https://api.rsywx.com)).

Recently, I updated my PHP to 8.1 and when I visited the site, it gives the following error:

```auto
{
    "statusCode": 500,
    "error": {
        "type": "SERVER_ERROR",
        "description": "ERROR: Return type of App\\Application\\Actions\\ActionPayload::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice on line 67 in file \/home\/tr\/www\/api.rsywx.com\/src\/Application\/Actions\/ActionPayload.php."
    }
}

```

I have not changed anything in my source code, so I guess the problem raises from Slim framework itself.

Any hints to solve this issue?

---

<div class="post-metadata">

**Author:** ![odan](https://avatars.discourse-cdn.com/v4/letter/o/9de053/32.png) [@odan](https://discourse.slimframework.com/u/odan)\
**Post date:** [January 25, 2022, 3:09pm UTC](https://discourse.slimframework.com/t/slim-in-php-8-1-shows-strange-errors/5089/2 "2022-01-25T15:09:19Z")

</div>

Can you please report this bug here? [Issues · slimphp/Slim · GitHub](https://github.com/slimphp/Slim/issues)

Edit: Here is the Github Issue: [Slim in PHP 8.1: site returns error · Issue #3143 · slimphp/Slim · GitHub](https://github.com/slimphp/Slim/issues/3143)

This was a `Slim-Skeleton` issue that’s been fixed.

See [slimphp/Slim-Skeleton#252](https://github.com/slimphp/Slim-Skeleton/pull/252)
