Title: Warning: array offset on float in class-evaluate-phpspreadsheet.php (fix include
Last modified: November 14, 2025

---

# Warning: array offset on float in class-evaluate-phpspreadsheet.php (fix include

 *  Resolved [zzzblxx](https://wordpress.org/support/users/zzzblxx/)
 * (@zzzblxx)
 * [6 months, 3 weeks ago](https://wordpress.org/support/topic/warning-array-offset-on-float-in-class-evaluate-phpspreadsheet-php-fix-include/)
 * Hi,
 * I’m using the latest version of TablePress and encountered repeated warnings 
   in the PHP-FPM/Nginx error log:
 * PHP Warning: Trying to access array offset on float in /wp-content/plugins/tablepress/
   classes/class-evaluate-phpspreadsheet.php on line 49
 * It occurs during formula evaluation inside:
 * TablePress_Evaluate_PHPSpreadsheet::evaluate_table_data()
 * Specifically, at this line:
 *     ```wp-block-code
       if ( '' === $cell_content || '=' === $cell_content || '=' !== $cell_content[0] ) {
       ```
   
 * When `$cell_content` is a float or integer (not a string), accessing `$cell_content[
   0]` causes:
 *     ```wp-block-code
       Trying to access array offset on float
       ```
   
 * This happened because my plugin populates the table with numeric values (floats/
   ints), not only strings.
 * ============Temporary Fix That Resolved It============
 * Before the condition, I added an explicit cast:
 *     ```wp-block-code
       $cell_content = (string) $cell_content;
       ```
   
 * This avoids the warning entirely and everything works normally. Additional Context
 * I also noticed high CPU usage around the same time, but I can’t confirm that 
   this warning is directly responsible. Mentioning it only because the error log
   was filled with thousands of these warnings.
 * ============Environment============
    - Block Theme: no
    - TablePress: 3.2.5
    - TablePress (DB): 119
    - TablePress table scheme: 3
    - Plan: Free
    - Plugin installed: 2024/04/16 14:04:50
    - WordPress: 6.8.3
    - Multisite: no
    - PHP: 8.3.10
    - mySQL (Server): 10.5.25-MariaDB
    - mySQL (Client): mysqlnd 8.3.10
    - mbstring: yes
    - ZipArchive: **no**
    - DOMDocument: yes
    - simplexml_load_string: yes
    - libxml_disable_entity_loader: yes
    - UTF-8 conversion: yes
    - WP Memory Limit: 40M
    - Server Memory Limit: 256M
    - WP_DEBUG: false
    - WP_POST_REVISIONS: true

Viewing 1 replies (of 1 total)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [6 months, 3 weeks ago](https://wordpress.org/support/topic/warning-array-offset-on-float-in-class-evaluate-phpspreadsheet-php-fix-include/#post-18719201)
 * Hi,
 * Thanks for your post and your code suggestion!
 * TablePress explicitly converts the cell content to a string whenever a table 
   is edited, see [https://github.com/TablePress/TablePress/blob/3.2.5/models/model-table.php#L886-L891](https://github.com/TablePress/TablePress/blob/3.2.5/models/model-table.php#L886-L891)
 * Thus, checking for a string would be unnecessary in all normal circumstances.
 * I therefore recommend that you simply convert the ints/floats that you are adding
   with your plugin to strings.
 * Best wishes,
   Tobias

Viewing 1 replies (of 1 total)

The topic ‘Warning: array offset on float in class-evaluate-phpspreadsheet.php (
fix include’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [6 months, 3 weeks ago](https://wordpress.org/support/topic/warning-array-offset-on-float-in-class-evaluate-phpspreadsheet-php-fix-include/#post-18719201)
 * Status: resolved