Title: syntax error, unexpected T_FUNCTION after upgrade
Last modified: February 6, 2019

---

# syntax error, unexpected T_FUNCTION after upgrade

 *  Resolved [patent](https://wordpress.org/support/users/patent/)
 * (@patent)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-after-upgrade/)
 * Hello!
    I’ve updated my WP to version 5.0.3. Then I’ve done the same for some
   plugins including this one (Subscribe2) and got an error on my site:
 * `Parse error: syntax error, unexpected T_FUNCTION in /home/virtwww/.../http/wp-
   content/plugins/subscribe2/classes/class-s2-block-editor.php on line 30`
 * I renamed ‘subscribe2’ folder via FTP and my site resumed.
 * How can I solve this problem to continue working with that plugin?
    Thanks in
   advance!

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

1 [2](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-after-upgrade/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-after-upgrade/page/2/?output_format=md)

 *  [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * (@mattyrob)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-after-upgrade/#post-11178525)
 * [@patent](https://wordpress.org/support/users/patent/)
 * Where are you seeing this error? Frontend or admin? Only certain pages or everywhere?
 * Also what version of PHP is your site using?
 * I have not seen this myself.
 *  Thread Starter [patent](https://wordpress.org/support/users/patent/)
 * (@patent)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-after-upgrade/#post-11178650)
 * > Where are you seeing this error?
 * On the front page of my site. It doesn’t load normally, just showing the above
   error message. It happens immediately after enabling that plugin.
 * PHP Version 7.3.1
 *  [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * (@mattyrob)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-after-upgrade/#post-11179887)
 * [@patent](https://wordpress.org/support/users/patent/)
 * I’m going to try testing this when I get time but for now I wonder if we should
   rule out a corrupt file.
 * If you have already renamed the plugin folder you can try re-installing from 
   the WordPress admin menus and see if that resolves things.
 *  Thread Starter [patent](https://wordpress.org/support/users/patent/)
 * (@patent)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-after-upgrade/#post-11179927)
 * I’ve removed it via admin control panel and installed a new one from the WP catalogue.
   
   My website still crashes once I press ‘Activate’ link for this plugin 🙁
 *  [mrsandy](https://wordpress.org/support/users/mrsandy/)
 * (@mrsandy)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-after-upgrade/#post-11180087)
 * I’m pressed update plugin button today. And I have that the same problem too.(
   PHP ver. 5.2 )
 *  [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * (@mattyrob)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-after-upgrade/#post-11181129)
 * [@patent](https://wordpress.org/support/users/patent/) [@mrsandy](https://wordpress.org/support/users/mrsandy/)
 * This is very strange, I’ve tested on PHP 7.3.1, 5.6.39 and 7.2.14 and I cannot
   reproduce this error.
 * I’m wondering about a plugin conflict – could you perhaps list what other active
   plugins you are using?
 *  [Collins Agbonghama](https://wordpress.org/support/users/collizo4sky/)
 * (@collizo4sky)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-after-upgrade/#post-11181241)
 * [@patent](https://wordpress.org/support/users/patent/) [@mrsandy](https://wordpress.org/support/users/mrsandy/)
   This happens when your PHP is older than 5.3. Anonymous function support wasn’t
   available until 5.3, so PHP won’t recognize function signatures passed as parameters
   like that.
 * Upgrade your PHP version.
 *  Thread Starter [patent](https://wordpress.org/support/users/patent/)
 * (@patent)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-after-upgrade/#post-11182600)
 * **Collins Agbonghama**, as I posted above my site is using PHP 7.3.1. Is this
   an old version? What’s the actual one?
 * [@mattyrob](https://wordpress.org/support/users/mattyrob/), here you are:
 * Akismet Anti-Spam
    AntiVirus Disable XML-RPC Maintenance Mode Print, PDF & Email
   by PrintFriendly Visitor Maps Geolocation Addon Visitor Maps и Who’s Online WP
   Social Bookmarking WP-PostViews WP-Polls User Photo
 *  Thread Starter [patent](https://wordpress.org/support/users/patent/)
 * (@patent)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-after-upgrade/#post-11182611)
 * I’m also using ‘Twenty Ten’ theme v. 2.7 (the last one)
 *  [Collins Agbonghama](https://wordpress.org/support/users/collizo4sky/)
 * (@collizo4sky)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-after-upgrade/#post-11182612)
 * Must have missed that. Let’s see what mattyrob can find.
 *  [mrsandy](https://wordpress.org/support/users/mrsandy/)
 * (@mrsandy)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-after-upgrade/#post-11182759)
 * I was change php version to 7.3 and error was gone. Thanks.
 *  [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * (@mattyrob)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-after-upgrade/#post-11183170)
 * [@patent](https://wordpress.org/support/users/patent/)
 * I haven’t tested this yet but having looked at the code of the Antivirus plugin
   I wonder if it’s changing something and conflicting.
    I presume it’s this one:
   [https://wordpress.org/plugins/antivirus/](https://wordpress.org/plugins/antivirus/)
 * Can you try disabling that plugin and then activate Subscribe2.
 * Also, could you give a link to the site you are having this issue on?
 *  Thread Starter [patent](https://wordpress.org/support/users/patent/)
 * (@patent)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-after-upgrade/#post-11187488)
 * I have snooped the decision from the neighbor thread. It’s about switching to
   the _classic_ editor (via plugin). **Voila**: that syntax error has disappeared!
 * And now… How can I revert back the list of my subscribers?
 *  Thread Starter [patent](https://wordpress.org/support/users/patent/)
 * (@patent)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-after-upgrade/#post-11187499)
 * … and all other settings like email templates etc.
 *  [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * (@mattyrob)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-after-upgrade/#post-11187704)
 * [@patent](https://wordpress.org/support/users/patent/)
 * Can you link to the neighbour thread so we can see if we can apply a fix for 
   this issue.
 * Provided you only renamed the plugin folder and didn’t uninstall from the WordPress
   admin area all of your subscriber data and settings should be preserved. If you
   uninstalled then you’ll need to restore data from a backup – either your own 
   or one from your hosting provider.
 * Specifically you need to restore the `wp_subscribe2` table for public subscribers,
   the `wp_usermeta` table for registered user data (but be careful here as you 
   could over-write newer data, and you’ll need the `subscribe2_options` entry from
   the `wp_options` table.

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

1 [2](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-after-upgrade/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-after-upgrade/page/2/?output_format=md)

The topic ‘syntax error, unexpected T_FUNCTION after upgrade’ is closed to new replies.

 * ![](https://ps.w.org/subscribe2/assets/icon-256x256.png?rev=2318630)
 * [Subscribe2 - Form, Email Subscribers & Newsletters](https://wordpress.org/plugins/subscribe2/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/subscribe2/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/subscribe2/)
 * [Active Topics](https://wordpress.org/support/plugin/subscribe2/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/subscribe2/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/subscribe2/reviews/)

 * 18 replies
 * 4 participants
 * Last reply from: [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/syntax-error-unexpected-t_function-after-upgrade/page/2/#post-11190402)
 * Status: resolved