Title: unexpected T_FUNCTION error
Last modified: August 31, 2016

---

# unexpected T_FUNCTION error

 *  Resolved [kwss](https://wordpress.org/support/users/kwss/)
 * (@kwss)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/unexpected-t_function-error-1/)
 * After latest update 1.5.0 i’ve just got unexpected T_FUNCTION error. Can it be
   fixed somehow?
 * [https://wordpress.org/plugins/bop-search-box-item-type-for-nav-menus/](https://wordpress.org/plugins/bop-search-box-item-type-for-nav-menus/)

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

 *  Plugin Author [joe_bopper](https://wordpress.org/support/users/joe_bopper/)
 * (@joe_bopper)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/unexpected-t_function-error-1/#post-6948098)
 * Hi kwss,
 * Sorry to hear you’re having issues. It sounds like your server is running a very
   out of date version of PHP. I’m pretty sure the error is due to the plugin’s 
   use of anonymous functions which is a feature that has been available since PHP
   5.3.
 * **PHP 5.2 stopped receiving security updates 5 years ago** and the most modern
   version of PHP is now 7.0. Moreover WordPress recommends using PHP 5.6 or higher
   and warns against anything earlier due to the potential security vulnerabilities–
   [https://wordpress.org/about/requirements/](https://wordpress.org/about/requirements/)
 * **I would recommend asking your hosting service to update your site’s php** (
   and their servers in general). If they’re unwilling/want to charge you/don’t 
   know how, which would be very worrying, you can try adding the following lines
   to the top of your .htaccess file (in your site root):
 *     ```
       RemoveType .php
       AddType x-httpd-php56 .php
       ```
   
 * Be warned that this can break your site if your server’s PHP 5.6 mime type is
   named differently (though it likely isn’t). If it does, just delete the lines
   and it’ll work fine again.
 * If neither of those work, let me know and I’ll look into making a side branch
   of version 1.5.0 that is PHP 5.2 friendly.
 * Cheers,
    Joe
 *  Plugin Author [joe_bopper](https://wordpress.org/support/users/joe_bopper/)
 * (@joe_bopper)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/unexpected-t_function-error-1/#post-6948120)
 * Apologies. I didn’t intend to mark this as resolved and have switched it back.
 *  Thread Starter [kwss](https://wordpress.org/support/users/kwss/)
 * (@kwss)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/unexpected-t_function-error-1/#post-6948149)
 * thank you!

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

The topic ‘unexpected T_FUNCTION error’ is closed to new replies.

 * ![](https://ps.w.org/bop-search-box-item-type-for-nav-menus/assets/icon-128x128.
   png?rev=1067133)
 * [Bop Search Box Item Type For Nav Menus](https://wordpress.org/plugins/bop-search-box-item-type-for-nav-menus/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/bop-search-box-item-type-for-nav-menus/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/bop-search-box-item-type-for-nav-menus/)
 * [Active Topics](https://wordpress.org/support/plugin/bop-search-box-item-type-for-nav-menus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bop-search-box-item-type-for-nav-menus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bop-search-box-item-type-for-nav-menus/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [kwss](https://wordpress.org/support/users/kwss/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/unexpected-t_function-error-1/#post-6948149)
 * Status: resolved