Title: Warning: Illegal offset
Last modified: August 21, 2016

---

# Warning: Illegal offset

 *  [wolfman123](https://wordpress.org/support/users/wolfman123/)
 * (@wolfman123)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/warning-illegal-offset-1/)
 * Hi,
 * I do have this problem since updating the plugin:
    Warning: Illegal offset type
   in D:\hosting\6799661\html\wp\wp-content\plugins\contact-form-7\includes\shortcodes.
   php on line 15
 * if you google for:
    “Warning: Illegal offset type in plugins\contact-form-7\includes\
   shortcodes.php on line 15”
 * you’ll find thousands of those entries..
 * Can you tell me how to fix the problem?
 * Thanks
 * [http://wordpress.org/extend/plugins/contact-form-7/](http://wordpress.org/extend/plugins/contact-form-7/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/warning-illegal-offset-1/#post-3650427)
 * From what version to what version did you try to upgrade the plugin?
 *  Thread Starter [wolfman123](https://wordpress.org/support/users/wolfman123/)
 * (@wolfman123)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/warning-illegal-offset-1/#post-3650492)
 * It think it was 3.3.3
 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/warning-illegal-offset-1/#post-3650529)
 * How did you upgrade it? Did you use automatic upgrade?
 *  Thread Starter [wolfman123](https://wordpress.org/support/users/wolfman123/)
 * (@wolfman123)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/warning-illegal-offset-1/#post-3650561)
 * yes, the automatic upgrade
 *  [frenchesco](https://wordpress.org/support/users/frenchesco/)
 * (@frenchesco)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/warning-illegal-offset-1/#post-3650663)
 * I was getting a similar error message when I updated Contact Form 7 to version
   3.4.2. Replacing the `add_shortcode` function in `wp-content/plugins/contact-
   form-7/includes/shortcodes.php` from this:
 *     ```
       function add_shortcode( $tag, $func, $has_name = false ) {
           if ( is_callable( $func ) )
               $this->shortcode_tags[$tag] = array(
                   'function' => $func,
                   'has_name' => (boolean) $has_name );
       }
       ```
   
 * …to this:
 *     ```
       function add_shortcode( $tag, $func, $has_name = false ) {
           if ( ! is_callable( $func ) )
               return;
   
           $tags = array_filter( array_unique( (array) $tag ) );
   
           foreach ( $tags as $tag ) {
               $this->shortcode_tags[$tag] = array(
                   'function' => $func,
                   'has_name' => (boolean) $has_name );
           }
       }
       ```
   
 * …seemed to work for me. I think it has something to do with a change in PHP 5.4
   and how it handles `$this`.

Viewing 5 replies - 1 through 5 (of 5 total)

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

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [frenchesco](https://wordpress.org/support/users/frenchesco/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/warning-illegal-offset-1/#post-3650663)
 * Status: not resolved