Title: PHP 8 errors
Last modified: September 28, 2022

---

# PHP 8 errors

 *  [davidwebca](https://wordpress.org/support/users/davidwebca/)
 * (@davidwebca)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/php-8-errors-7/)
 * Hi,
 * Since PHP 8, undefined array keys have changed from notices to warnings which
   raises Exceptions in various situations and setups.
 * There are multiple undefined array keys accessed in admin/admin.php, especially
   on line 658 and 659. I’ve had to fix it with the null coalesce operator to be
   able to save my Tag Manager id.
 *     ```
       $container_on_off = (bool) ($options['container-on'] ?? false);
       $container_compat = (int) ($options['compat-mode'] ?? 0);
       ```
   
 * Hope this helps for others stumbling onto this error and hope the plugin is updated
   and tested for php 8 soon.
 * Thanks!

The topic ‘PHP 8 errors’ is closed to new replies.

 * ![](https://ps.w.org/duracelltomi-google-tag-manager/assets/icon-256x256.png?
   rev=1708451)
 * [GTM4WP - A Google Tag Manager (GTM) plugin for WordPress](https://wordpress.org/plugins/duracelltomi-google-tag-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/duracelltomi-google-tag-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/duracelltomi-google-tag-manager/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [davidwebca](https://wordpress.org/support/users/davidwebca/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/php-8-errors-7/)
 * Status: not resolved