Title: PHP Warning: Illegal string offset &#8216;last&#8217;
Last modified: May 24, 2023

---

# PHP Warning: Illegal string offset ‘last’

 *  Resolved [chargeup](https://wordpress.org/support/users/chargeup/)
 * (@chargeup)
 * [3 years ago](https://wordpress.org/support/topic/php-warning-illegal-string-offset-last/)
 * Just want to give you a heads up. I’ve been seeing a lot of the following warnings
   the past few months in my PHP logs on all sites using WPForms.
 * [09-May-2023 01:32:25 UTC] PHP Warning: Illegal string offset ‘first’ in /home/
   customer/www/www….com/public_html/wp-content/plugins/wpforms-lite/includes/fields/
   class-name.php on line 508
 * [09-May-2023 01:32:25 UTC] PHP Warning: Illegal string offset ‘last’ in /home/
   customer/www/www….com/public_html/wp-content/plugins/wpforms-lite/includes/fields/
   class-name.php on line 512

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/topic/php-warning-illegal-string-offset-last/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/php-warning-illegal-string-offset-last/page/2/?output_format=md)

 *  Plugin Support [Ralden Souza](https://wordpress.org/support/users/rsouzaam/)
 * (@rsouzaam)
 * [3 years ago](https://wordpress.org/support/topic/php-warning-illegal-string-offset-last/#post-16767949)
 * Hi [@chargeup](https://wordpress.org/support/users/chargeup/),
 * Please know that I could not find an issue open for that PHP warning.
 * In case you’re not using WPForms version 1.8.1.x, it’s possible that this is 
   either causing or contributing to the issues that you’re seeing, so we need to
   start updating your WPForms version. In case it helps, WPBeginner has a [detailed tutorial on how to update plugins on your site](https://www.wpbeginner.com/beginners-guide/how-to-properly-update-wordpress-plugins-step-by-step/).
 * If you’re using WPForms 1.8.1.x, could you please share a few details that I 
   can use to replicate this issue? Also, please let me know your WordPress, WPForms
   and PHP versions. That way, we can try to reproduce the issue and investigate
   it.
 * I’m looking forward to your response.
 * Thanks!
 *  Plugin Support [Ralden Souza](https://wordpress.org/support/users/rsouzaam/)
 * (@rsouzaam)
 * [3 years ago](https://wordpress.org/support/topic/php-warning-illegal-string-offset-last/#post-16768091)
 * Hi [@chargeup](https://wordpress.org/support/users/chargeup/),
 * We tried to reproduce the issue, but we had no success.
 * From previous alert warnings like this, we saw some situations where the issue
   was due to a custom code snippet, especially in the theme’s functions.php file.
 * Could you please verify custom code snippets on your site, especially in functions.
   php?
 * Thanks, and please let me know!
 *  Thread Starter [chargeup](https://wordpress.org/support/users/chargeup/)
 * (@chargeup)
 * [3 years ago](https://wordpress.org/support/topic/php-warning-illegal-string-offset-last/#post-16768334)
 * Thanks for the quick response. Here is the system information:
 *     ```wp-block-code
       Begin System Info
   
       -- WPForms Info
   
       Lite: Aug 16, 2022 @ 4:17pm
       Lite Connect: Backup is enabled since Aug 19, 2022 @ 1:44pm
   
       -- Site Info
   
       Site URL: https://www...com
       Home URL: https://www...com
       Multisite: No
   
       -- WordPress Configuration
   
       Version: 6.2.2
       Language: en_US
       User Language: en_US
       Permalink Structure: /%postname%/
       Active Theme: Astra Child 1.0.0
       Show On Front: page
       Page On Front: Home (#105)
       Page For Posts: Unset
       ABSPATH: /home/customer/www/www....com/public_html/
       Table Prefix: Length: 4 Status: Acceptable
       WP_DEBUG: Disabled
       WPFORMS_DEBUG: Not set
       Memory Limit: 256M
       Registered Post Stati: publish, future, draft, pending, private, trash, auto-draft, inherit, request-pending, request-confirmed, request-failed, request-completed
       Revisions: Enabled
   
       -- WordPress Uploads/Constants
   
       WP_CONTENT_DIR: /home/customer/www/www...com/public_html/wp-content
       WP_CONTENT_URL: https://www...com/wp-content
       UPLOADS: Not set
       wp_uploads_dir() path: /home/customer/www/www...com/public_html/wp-content/uploads/2023/05
       wp_uploads_dir() url: https://www...com/wp-content/uploads/2023/05
       wp_uploads_dir() basedir: /home/customer/www/www...com/public_html/wp-content/uploads
       wp_uploads_dir() baseurl: https://www...com/wp-content/uploads
   
       -- WordPress Active Plugins
   
       Astra Pro: 4.1.5
       Contact Form Entries: 1.3.1
       Elementor: 3.13.3
       Elementor Header & Footer Builder: 1.6.14
       SiteGround Optimizer: 7.3.1
       SiteGround Security: 1.4.5
       WP Armour - Honeypot Anti Spam: 2.1.4
       WPForms Lite: 1.8.1.3
       WP Mail SMTP: 3.8.0
       WP Rocket: 3.13.3
       Yoast SEO: 20.8
   
       -- WordPress Inactive Plugins
   
       Elementor Pro: 3.7.3
       Gravity Forms: 2.6.5
       iThemes Security Pro: 7.1.3
   
       -- Webserver Configuration
   
       PHP Version: 7.4.33
       MySQL Version: 5.7.39
       Webserver Info: Apache
   
       -- PHP Configuration
   
       Memory Limit: 768M
       Upload Max Size: 256M
       Post Max Size: 256M
       Upload Max Filesize: 256M
       Time Limit: 120
       Max Input Vars: 3000
       Display Errors: On (1)
   
       -- PHP Extensions
   
       cURL: Supported
       fsockopen: Supported
       SOAP Client: Installed
       Suhosin: Not Installed
   
       -- Session Configuration
   
       Session: Disabled
   
       End System Info
       ```
   
 *  Thread Starter [chargeup](https://wordpress.org/support/users/chargeup/)
 * (@chargeup)
 * [3 years ago](https://wordpress.org/support/topic/php-warning-illegal-string-offset-last/#post-16768352)
 * There aren’t any custom snippets or custom code in the functions.php file and
   I’m using Astra.
 * I’ve also checked the access logs and the timestamp is indeed matching up for
   when the form attempt is happening.
 * However, the form doesn’t get submitted and there aren’t any entries.
 * It looks like the warning revolves around extended validation in the code from
   that particular file.
 * // Extended validation needed for the different name fields.
 * Could this just be a spammer attempting to enter code or something else into 
   that field and it’s triggering the warning? I’m just thinking out loud.
 *  Plugin Support [Ralden Souza](https://wordpress.org/support/users/rsouzaam/)
 * (@rsouzaam)
 * [3 years ago](https://wordpress.org/support/topic/php-warning-illegal-string-offset-last/#post-16769198)
 * Hi [@chargeup](https://wordpress.org/support/users/chargeup/),
 * Thanks for all the information!
 * It’s weird because looking at the lines 508 and 512 in the class-name.php file,
   it’s just a doc block, and here’s a screenshot: [https://a.supportally.com/i/gziXrp](https://a.supportally.com/i/gziXrp).
 * Looking at the system information, we could see some third-party plugins that
   might be related to the issue.
 * When you get the chance, could you please try using the steps in WPBeginner’s
   detailed guide on [troubleshooting WordPress](https://www.wpbeginner.com/beginners-guide/beginners-guide-to-troubleshooting-wordpress-errors-step-by-step/)
   to see if it helps resolve the issue?
 * Thanks!
 *  Plugin Support [Ralden Souza](https://wordpress.org/support/users/rsouzaam/)
 * (@rsouzaam)
 * [3 years ago](https://wordpress.org/support/topic/php-warning-illegal-string-offset-last/#post-16769217)
 * It looks like there might be a conflict between the forms and the site theme 
   or another plugin. In this case, you can also try the steps described in our 
   detailed guide on [how to test for plugin/theme conflicts](https://wpforms.com/docs/how-to-test-for-theme-or-plugin-conflicts/).
 * Hope this helps!
 *  Thread Starter [chargeup](https://wordpress.org/support/users/chargeup/)
 * (@chargeup)
 * [3 years ago](https://wordpress.org/support/topic/php-warning-illegal-string-offset-last/#post-16769570)
 * My apologies. I actually pulled that from a staging site using 1.7.8. The code
   snippets are the same. 508 in that version is the exact same as line 526 & 530
   in 1.8.1.3.
 * I’m not sure your assessment of it being a theme or plugin issue is accurate.
   I know this is a pretty common response from every theme and plugin author I’ve
   used. I use WPForms on all types of sites with different themes and plugins. 
   I have gotten the same warnings for quite some time across pretty much all of
   my sites.
 * May or may not be a similar issue but here is another user who reported a similar
   bug from a different file about 2 years ago. You found the issue on that file
   so might be worth taking a deeper look.
 * [https://wordpress.org/support/topic/warnings-logged-illegal-string-offset-primary-in-class-email-php/](https://wordpress.org/support/topic/warnings-logged-illegal-string-offset-primary-in-class-email-php/)
 *  Plugin Support [Ralden Souza](https://wordpress.org/support/users/rsouzaam/)
 * (@rsouzaam)
 * [3 years ago](https://wordpress.org/support/topic/php-warning-illegal-string-offset-last/#post-16772109)
 * Hi [@chargeup](https://wordpress.org/support/users/chargeup/),
 * If I correctly understood, the PHP warnings came from WPForms version 1.7.8. 
   Could you please confirm if you were able to reproduce the issue using the version
   1.8.1.3?
 * This issue should not happen with WPForms 1.8.1.x. Similar the topic that you
   shared, where the issue was with WPForms 1.6.3.1, and it was fixed on 1.6.4.
 * But if you can reproduce the issue on WPForms 1.8.1.3, could you please share
   a few details on how I can reproduce this issue? If possible, please share a 
   video showing your steps to generate the PHP warning.
 * Thanks, and please let me know!
 *  [Prashant Rai](https://wordpress.org/support/users/prashantrai/)
 * (@prashantrai)
 * [2 years, 12 months ago](https://wordpress.org/support/topic/php-warning-illegal-string-offset-last/#post-16777639)
 * Hey [@chargeup](https://wordpress.org/support/users/chargeup/) – I’m Prashant
   filling in for Ralden as he’s currently unavailable. We haven’t heard back from
   you in a few days, so I’m going to go ahead and close this thread for now. But
   if you’d like us to assist further, please feel welcome to continue the conversation.
 * Thanks!
 *  Thread Starter [chargeup](https://wordpress.org/support/users/chargeup/)
 * (@chargeup)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/php-warning-illegal-string-offset-last/#post-16797805)
 * Just want to let you know everything is up-to-date and the error is still present.
   WPForms is at version 1.8.1.3. I have no idea how to reproduce it. I have tried.
   I’m assuming it has something to do with bots. Maybe the other topic I shared
   is a good way to reproduce it on your end.
 * Here is the latest error I received:
 * PHP Warning: Illegal string offset ‘first’ in /home/customer/www/www…com/public_html/
   wp-content/plugins/wpforms-lite/includes/fields/class-name.php on line 527
 *  [Prashant Rai](https://wordpress.org/support/users/prashantrai/)
 * (@prashantrai)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/php-warning-illegal-string-offset-last/#post-16801941)
 * Hey [@chargeup](https://wordpress.org/support/users/chargeup/) – Thanks for following
   on this ticket!
 * When you have sometime, can you please share the [export copy of the form](https://wpforms.com/docs/how-to-import-and-export-wpforms/)
   so we can do some testing?
 * Kindly,
 *  Thread Starter [chargeup](https://wordpress.org/support/users/chargeup/)
 * (@chargeup)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/php-warning-illegal-string-offset-last/#post-16804114)
 * I’ve downloaded the form. However, it doesn’t look like there is a way to upload
   the json file here. Any suggestions?
 *  [Prashant Rai](https://wordpress.org/support/users/prashantrai/)
 * (@prashantrai)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/php-warning-illegal-string-offset-last/#post-16807522)
 * Hey [@chargeup](https://wordpress.org/support/users/chargeup/) – Thanks for your
   intrest in this ticket!
 * You can use file sharing tools like Google Drive orDropbox to upload the file,
   and share the URL here.
 * Kindly,
 *  Thread Starter [chargeup](https://wordpress.org/support/users/chargeup/)
 * (@chargeup)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/php-warning-illegal-string-offset-last/#post-16807599)
 * Here you go:
 * [https://drive.google.com/file/d/1M4MX2P7CpvO_QndWFalvzuu28Mh84lVu/view?usp=sharing](https://drive.google.com/file/d/1M4MX2P7CpvO_QndWFalvzuu28Mh84lVu/view?usp=sharing)
 *  Plugin Support [Ralden Souza](https://wordpress.org/support/users/rsouzaam/)
 * (@rsouzaam)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/php-warning-illegal-string-offset-last/#post-16813239)
 * Hi [@chargeup](https://wordpress.org/support/users/chargeup/),
 * Thanks for sharing the form. However, I was not able to reproduce any PHP warning
   related to WPForms.
 * I created a new local site to try your form, and the only error logs were related
   to the Astra theme. For your reference, I created [this screencast](https://a.supportally.com/v/HiGlM0).
 * It looks like there might be a conflict between the forms and your Pro version
   of the Astra theme or another plugin. To troubleshoot this, please try the steps
   described in our detailed guide on [how to test for plugin/theme conflicts](https://wpforms.com/docs/how-to-test-for-theme-or-plugin-conflicts/).
 * Hope this helps!

Viewing 15 replies - 1 through 15 (of 22 total)

1 [2](https://wordpress.org/support/topic/php-warning-illegal-string-offset-last/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/php-warning-illegal-string-offset-last/page/2/?output_format=md)

The topic ‘PHP Warning: Illegal string offset ‘last’’ is closed to new replies.

 * ![](https://ps.w.org/wpforms-lite/assets/icon.svg?rev=3254748)
 * [WPForms - Easy Form Builder for WordPress - Contact Forms, Payment Forms, Surveys, & More](https://wordpress.org/plugins/wpforms-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpforms-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpforms-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/wpforms-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpforms-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpforms-lite/reviews/)

 * 22 replies
 * 3 participants
 * Last reply from: [Ralden Souza](https://wordpress.org/support/users/rsouzaam/)
 * Last activity: [2 years, 10 months ago](https://wordpress.org/support/topic/php-warning-illegal-string-offset-last/page/2/#post-16904546)
 * Status: resolved