Title: Error with PHP 8.1
Last modified: February 8, 2023

---

# Error with PHP 8.1

 *  Resolved [Jess](https://wordpress.org/support/users/onmauitime/)
 * (@onmauitime)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/error-with-php-8-1/)
 * Using a custom theme and receiving the following error. Seems the plugin conflicts
   with PHP 8.1.
 * How can I modify the enum file?
 * **Deprecated**: Return type of MyCLabs\Enum\Enum::jsonSerialize() should either
   be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange]
   attribute should be used to temporarily suppress the notice in [filepath]**/woocommerce-
   payments/vendor/myclabs/php-enum/src/Enum.php** on line **246**

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [anastas10s](https://wordpress.org/support/users/anastas10s/)
 * (@anastas10s)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/error-with-php-8-1/#post-16455610)
 * Hi there [@onmauitime](https://wordpress.org/support/users/onmauitime/)
 * Thank you for reaching out about this. From what I gather, this appeared right
   after setting the site’s PHP version to 8.1, correct?
 * Just to clarify, what was the previous PHP version in use? Also, what are the
   other PHP version options available with your installation?
 * To help you further, I’d like to understand more about your setup.
 * Could you please send me a copy of your site’s System Status? You can find it
   via `WooCommerce > Status`. Select `Get system report` and then `Copy for support`.
 * Once you’ve done that, you can paste the text in [https://gist.github.com/](https://gist.github.com/)
   and feel free to change/remove your site URL in the report for privacy reasons.
 * You can paste the Gist link here in your reply, once you have that.
 * Also, could you please navigate to `WooCommerce > Status > Logs` and from the
   dropdown on the right side, please see if there are any logs starting with the
   words fatal-error.
 * If so, please select `View` and copy and paste them into your reply here.
 * Looking forward to hearing from you!
 *  Thread Starter [Jess](https://wordpress.org/support/users/onmauitime/)
 * (@onmauitime)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/error-with-php-8-1/#post-16456757)
 * Here is the GIST: 
   [https://gist.github.com/cloudcreationsjess/6179ed35ca55aa49094be3015971d0ca](https://gist.github.com/cloudcreationsjess/6179ed35ca55aa49094be3015971d0ca)
   Using PHP 8.1.9, this happened when I upgraded my theme to the newest Roots Sage
   10 with **Bedrock**. I don’t think I can easily use any other version of PHP 
   with Sage 10, but if needed I can try and downgrade to PHP 8.0.2. Right now I
   am on a Local WP server set up. No fatal errors.I tried to enable the plugin 
   on another site that uses the the Roots Sage 10 theme with PHP 8.1.9 and it works.
   The only difference between the two sites is [Bedrock.](https://roots.io/bedrock/)
   So that may be a clue? Thanks for the help!
 *  [anastas10s](https://wordpress.org/support/users/anastas10s/)
 * (@anastas10s)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/error-with-php-8-1/#post-16465736)
 * Howdy [@onmauitime](https://wordpress.org/support/users/onmauitime/)
 * Thank you for reaching back, with further information on this.
 * Upon investigating the System Status Report (SSR) you are sharing here, I noticed
   that an SSL certificate is not available. Just to note, this is one of the requirements
   of the WooCommerce Payments plugin, as can be [verified here](https://woocommerce.com/document/woocommerce-payments/startup-guide/#requirements).
 * I went ahead with running tests of my own, being able to reproduce the issue 
   and, subsequently, went ahead with filing a [GitHub issue #5533](https://github.com/Automattic/woocommerce-payments/issues/5533).
 * Per the [questions posted here](https://github.com/Automattic/woocommerce-payments/issues/5533#issuecomment-1427157760),
   could you clarify:
    1. Does this issue _only_ occur with specific versions of PHP (e.g. 8.1)?
    2. Does `WP_DEBUG_DISPLAY` need to be set to `true` for these deprecation notices
       to be present?
    3. If you use a different version of PHP 8 (e.g. 8.1.15 or 8.2.2), are the deprecation
       notices still present?
 * Looking forward to hearing from you! Feel free to respond either in this thread,
   or over at the GitHub issue page. Thank you. 🙂
 *  [kadjoku](https://wordpress.org/support/users/kadjoku/)
 * (@kadjoku)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/error-with-php-8-1/#post-16549500)
 *     ```wp-block-code
       Deprecated: Return type of MyCLabs\Enum\Enum::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home4/mfgzu1o6/public_html/wp-content/plugins/woocommerce-payments/vendor/myclabs/php-enum/src/Enum.php on line 246
   
       Warning: Cannot modify header information - headers already sent by (output started at /home4/mfgzu1o6/public_html/wp-content/plugins/woocommerce-payments/vendor/myclabs/php-enum/src/Enum.php:21) in /home4/mfgzu1o6/public_html/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 1486
   
       Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /home4/mfgzu1o6/public_html/wp-content/plugins/elementor-pro/modules/loop-builder/module.php on line 200
   
       Deprecated: Return type of Requests_Cookie_Jar::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 /home4/mfgzu1o6/public_html/wp-includes/Requests/Cookie/Jar.php on line 63
   
       Deprecated: Return type of Requests_Cookie_Jar::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 /home4/mfgzu1o6/public_html/wp-includes/Requests/Cookie/Jar.php on line 73
   
       Deprecated: Return type of Requests_Cookie_Jar::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 /home4/mfgzu1o6/public_html/wp-includes/Requests/Cookie/Jar.php on line 89
   
       Deprecated: Return type of Requests_Cookie_Jar::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 /home4/mfgzu1o6/public_html/wp-includes/Requests/Cookie/Jar.php on line 102
   
       Deprecated: Return type of Requests_Cookie_Jar::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home4/mfgzu1o6/public_html/wp-includes/Requests/Cookie/Jar.php on line 111
   
       Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::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 /home4/mfgzu1o6/public_html/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 40
   
       Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::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 /home4/mfgzu1o6/public_html/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 51
   
       Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::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 /home4/mfgzu1o6/public_html/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 68
   
       Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::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 /home4/mfgzu1o6/public_html/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 82
   
       Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home4/mfgzu1o6/public_html/wp-includes/Requests/Utility/CaseInsensitiveDictionary.php on line 91
   
       Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in /home4/mfgzu1o6/public_html/wp-includes/formatting.php on line 4379
       ```
   
 * I had this warning pop up on my sites after I tried increasing my wp-memory limit
 *  in order to help me use some plugins but these warnings showed up as soon as
   the limit code was added. I’m quite new to this so some help would be awesome.
 *  [Igor H](https://wordpress.org/support/users/ihereira/)
 * (@ihereira)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/error-with-php-8-1/#post-16554611)
 * Hello, [@kadjoku](https://wordpress.org/support/users/kadjoku/)
 * Please create your own thread for your issue – [https://wordpress.org/support/plugin/woocommerce-payments/#new-topic-0](https://wordpress.org/support/plugin/woocommerce-payments/#new-topic-0).
 * We want to make sure that every user’s issues receive their own thread with proper
   attention.
    - [Frequently Asked Questions](https://wordpress.org/support/forum-user-guide/faq/).
 * It would be great if you please share your **_System Status _**in your new thread
   response, found under **_WooCommerce > Status _**on your site.
 * We’ll be glad to help.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Error with PHP 8.1’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-payments/assets/icon-256x256.png?rev=3234740)
 * [WooPayments: Integrated WooCommerce Payments](https://wordpress.org/plugins/woocommerce-payments/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-payments/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-payments/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-payments/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-payments/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-payments/reviews/)

## Tags

 * [elementor error](https://wordpress.org/support/topic-tag/elementor-error/)
 * [wp memory limit](https://wordpress.org/support/topic-tag/wp-memory-limit/)

 * 5 replies
 * 4 participants
 * Last reply from: [Igor H](https://wordpress.org/support/users/ihereira/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/error-with-php-8-1/#post-16554611)
 * Status: resolved