Title: Fatal error on PHP 8: Cannot access array offset in class-acf-data.php line 119
Last modified: January 15, 2026

---

# Fatal error on PHP 8: Cannot access array offset in class-acf-data.php line 119

 *  Resolved [Md Abdullah Al Fahad](https://wordpress.org/support/users/mabfahad/)
 * (@mabfahad)
 * [4 months, 2 weeks ago](https://wordpress.org/support/topic/fatal-error-on-php-8-cannot-access-array-offset-in-class-acf-data-php-line-119/)
 * Hello ACF team,
 * We are encountering a fatal error on PHP 8+ related to ACF internal data handling.
 * Error message:
   `Uncaught TypeError: Cannot access offset of type array in isset
   or emptyin wp-content/plugins/advanced-custom-fields-pro/includes/class-acf-data.
   php on line 119
 * Environment:
    - WordPress: latest
    - ACF PRO: latest (at time of writing)
    - PHP: 8.x
    - Theme: Custom theme
 * This error appears to occur when ACF attempts to access an array offset using
   a variable that is itself an array. PHP 8+ no longer allows this and throws a
   fatal TypeError.
 * Stack trace points to:
   `includes/class-acf-data.php:119`
 * This may be triggered by:
    - Invalid field keys passed to ACF core
    - Corrupted field data
    - ACF filters receiving unexpected array values
 * Suggested fix:
   Add defensive type checking before accessing offsets, e.g.:
 * `if ( is_string( $key ) || is_int( $key ) ) {
   isset( $array[ $key ] );}
 * or otherwise guard against array keys before using `isset()/empty()`.

Viewing 1 replies (of 1 total)

 *  Plugin Support [ACF Support](https://wordpress.org/support/users/acfsupport/)
 * (@acfsupport)
 * [4 months ago](https://wordpress.org/support/topic/fatal-error-on-php-8-cannot-access-array-offset-in-class-acf-data-php-line-119/#post-18796403)
 * Hi [@mabfahad](https://wordpress.org/support/users/mabfahad/),
 * Thanks for the detailed report and stack trace.
 * You are spot on with your analysis, this error almost always occurs when a custom
   function or filter passes an Array (instead of a String or Integer) as the `$
   selector` or `$post_id` argument to an ACF function like `get_field()` or `get_value()`.
   While previous PHP versions handled this loosely, PHP 8 throws a fatal error 
   immediately when an illegal offset type is used.
 * Since this forum is generally for user-to-user assistance, please create a ticket
   using our ​[support form](https://www.advancedcustomfields.com/contact/) so that
   we can help you investigate and implement this further.
 * Best regards,
   Pat

Viewing 1 replies (of 1 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffatal-error-on-php-8-cannot-access-array-offset-in-class-acf-data-php-line-119%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/advanced-custom-fields/assets/icon.svg?rev=3207824)
 * [Advanced Custom Fields (ACF®)](https://wordpress.org/plugins/advanced-custom-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-custom-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-custom-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-custom-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-custom-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-custom-fields/reviews/)

## Tags

 * [fatal error](https://wordpress.org/support/topic-tag/fatal-error/)

 * 1 reply
 * 2 participants
 * Last reply from: [ACF Support](https://wordpress.org/support/users/acfsupport/)
 * Last activity: [4 months ago](https://wordpress.org/support/topic/fatal-error-on-php-8-cannot-access-array-offset-in-class-acf-data-php-line-119/#post-18796403)
 * Status: resolved