Title: Php 8.x support &#8211; fix init.gravityform.php
Last modified: September 18, 2023

---

# Php 8.x support – fix init.gravityform.php

 *  [mbrinson](https://wordpress.org/support/users/mbrinson/)
 * (@mbrinson)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/php-8-x-support-fix-init-gravityform-php/)
 * Please update lines 476, 477, and 528, 529 so that the following PHP warning 
   is not triggered:
   “Trying to access array offset on value of type null in …/plugins/
   hitsteps-visitor-manager/init.gravityform.php”Please see this discussion for 
   an explanation of the issue:
 * [https://stackoverflow.com/questions/59336951/message-trying-to-access-array-offset-on-value-of-type-null](https://stackoverflow.com/questions/59336951/message-trying-to-access-array-offset-on-value-of-type-null)
 * The parent array $_hs_uid_data_cache needs to validated (in addition to the actual
   value of the array that is already checked with !isset($_hs_uid_data_cache[round(
   $_POST[`'_hs_uid_data`'])])) )
 * > This happens because `$cOTLdata` is null. Previous versions of PHP may have
   > been less strict on such mistakes and silently swallowed the error / notice
   > while 7.4 does not do this anymore.
   > To check whether `$cOTLdata` is null use [is_null()](https://www.php.net/is_null):
   >     ```wp-block-code
   >     is_null($cOTLdata)
   >     ```
   > 
   > Which means the line should look something like this:
   >     ```wp-block-code
   >     $len = is_null($cOTLdata) ? 0 : count($cOTLdata['char_data']);
   >     ```
   > 
   > However, in case both `$cOTLdata` and `$cOTLdata['char_data']` could not exist,
   > you can use `isset()` for both at once:
   >     ```wp-block-code
   >     $len = !isset($cOTLdata['char_data']) ? 0 : count($cOTLdata['char_data']);
   >     ```
   > 
   >  [https://stackoverflow.com/questions/59336951/message-trying-to-access-array-offset-on-value-of-type-null](https://stackoverflow.com/questions/59336951/message-trying-to-access-array-offset-on-value-of-type-null)

The topic ‘Php 8.x support – fix init.gravityform.php’ is closed to new replies.

 * ![](https://ps.w.org/hitsteps-visitor-manager/assets/icon-256x256.png?rev=1315814)
 * [Hitsteps Web Analytics](https://wordpress.org/plugins/hitsteps-visitor-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/hitsteps-visitor-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/hitsteps-visitor-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/hitsteps-visitor-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/hitsteps-visitor-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/hitsteps-visitor-manager/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [mbrinson](https://wordpress.org/support/users/mbrinson/)
 * Last activity: [2 years, 8 months ago](https://wordpress.org/support/topic/php-8-x-support-fix-init-gravityform-php/)
 * Status: not resolved