Title: Parse error: syntax error, unexpected T_FUNCTION in &#8230;
Last modified: September 1, 2016

---

# Parse error: syntax error, unexpected T_FUNCTION in …

 *  ResolvedPlugin Contributor [responsivemenu](https://wordpress.org/support/users/responsivemenu/)
 * (@responsivemenu)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-in-2/)
 * If you see the above notice when trying to activate it means you are using an
   outdated and insecure version of PHP.
 * Please upgrade to PHP 5.4+
 * [https://wordpress.org/plugins/responsive-menu/](https://wordpress.org/plugins/responsive-menu/)

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

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

 *  Plugin Contributor [responsivemenu](https://wordpress.org/support/users/responsivemenu/)
 * (@responsivemenu)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-in-2/#post-7565803)
 * P.S – If anyone has a server failing with this issue I would like FTP access 
   to someones setup so I can see if I can create a catch for this error and provide
   a useful error message instead.
 * I am willing to give a free Pro license in return.
 * All the best
 *  [spencerfacta](https://wordpress.org/support/users/spencerfacta/)
 * (@spencerfacta)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-in-2/#post-7565933)
 * Hey –
 * Just wanted to try and help provide more information as you diagnose. We are 
   running PHP 5.4.24 and experiencing this error – so I don’t think it’s entirely
   related to the outdated PHP version.
 * I also get a fatal error trying to enable the plugin on a sandbox WordPress WAMP
   site, no plugins installed, 2016 theme, PHP 5.5.12
 *  Plugin Contributor [responsivemenu](https://wordpress.org/support/users/responsivemenu/)
 * (@responsivemenu)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-in-2/#post-7565935)
 * Hi Spencer,
 * Is there any way to get access to that box as I was almost 100% sure it was due
   to anonymous functions in PHP 5.3 and below but obviously you’ve just disproved
   that.
 *  [spencerfacta](https://wordpress.org/support/users/spencerfacta/)
 * (@spencerfacta)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-in-2/#post-7565936)
 * Sorry, I would but I can’t give access to that site, only because I manage it
   for a client. But if you just spin off a sandbox/local WP instance, and activate
   only the plugin, you should be able to replicate it.
 * If not let me know, I can host a sandbox server on a subdomain somewhere.
 *  Plugin Contributor [responsivemenu](https://wordpress.org/support/users/responsivemenu/)
 * (@responsivemenu)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-in-2/#post-7565937)
 * Hi Spencer,
 * I will try and find a local box with PHP 5.4.24 somewhere and try and play around
   with it.
 * Do you get the same fatal error on the site with PHP 5.5.12 installed?
 * Everywhere I have searched on the web says that the error above is definetely
   for people below 5.4 so I’m tearing my hair out at the moment trying to work 
   this one out!
 * Can you triple confirm that those are the actual versions of PHP you are using.
 * For example simply do:
 * `<?php echo PHP_VERSION; ?>`
 * anywhere on your site and let me know what the output of that is?
 * Thanks for all your help
 *  [studioactiv8](https://wordpress.org/support/users/studioactiv8/)
 * (@studioactiv8)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-in-2/#post-7565940)
 * this one says where the error is happening ‘line 16’ if that helps ..
    Parse 
   error: syntax error, unexpected ‘[‘ in /httpdocs/wordpress/wp-content/plugins/
   responsive-menu/src/app/Routing/WpRouting.php on line 16
 *  [spencerfacta](https://wordpress.org/support/users/spencerfacta/)
 * (@spencerfacta)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-in-2/#post-7565941)
 * I apologize – the <?php phpinfo(); ?> shows me that site is running PHP 5.2. 
   Strangely the cpanel said otherwise.
 * And I noticed I’m getting a different error running on a sandbox site (which 
   I can confirm is PHP 5.5.12):
 * ( ! ) Warning: array_key_exists() expects parameter 2 to be array, null given
   in L:\wamp\www\sandbox2\wp-content\plugins\responsive-menu\src\app\Collections\
   OptionsCollection.php on line 63
 *  Plugin Contributor [responsivemenu](https://wordpress.org/support/users/responsivemenu/)
 * (@responsivemenu)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-in-2/#post-7565942)
 * Hi spencer,
 * That second issue is something else that is fixed in the newest release.
 * I am sure it is a 5.3 and below error (man 5.2 is super old!) but my plugin is
   supposed to disable itself whenever a PHP version is below 5.4 and that’s what’s
   worrying me more.
 * What version of my plugin do you have installed currently? Can you try and update
   to the latest (3.0.5) if you havent already and tell me if the plugin still doesn’t
   deactivate itself in the admin area?
 * Thanks again for the help
 *  [VesaT](https://wordpress.org/support/users/vesat/)
 * (@vesat)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-in-2/#post-7565979)
 * Hi Responsive Menu,
    at my local test environment – which I’m running on top 
   of AMPPS and using PHP 5.3 because of a very versatile theme development tool
   requiring it.
 * When I updated Responsive Menu to the newest 3.0.5 version, a parse error appeared
   and neither the admin side of WP nor the test site itself did not work at all.
   Then I deleted Responsive Menu and reinstalled it as a totally new plugin and
   it did not activate but displayed a text telling “could not activate the plugin
   as it caused an error”. Now the local test side works fine – but without Responsive
   Menu. But obviously Responsive Menu installation works as it should, preventing
   a parse error and closure of the site in total.
 * Looks like I need to find a way to run two local environments – one with PHP 
   5.3. and another with the newest PHP versions.
 *  Plugin Contributor [responsivemenu](https://wordpress.org/support/users/responsivemenu/)
 * (@responsivemenu)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-in-2/#post-7565988)
 * Hi Vesa,
 * This is annoying me because I have done everything I can think of to stop it 
   creating parse errors and fatal errors when the wrong PHP version is installed.
 * Im not sure if its an actual limitation of PHP itself in PHP 5.3 that means I
   cant get around this. I cant even find a server with php 5.3 on to test on as
   its so out of date now!
 * Thanks for the information its very helpful. i will have to find another way 
   around this. Is it possible that you can send me some screenshots of the errors
   you get when trying to upgrade?
 * All the best
 *  Plugin Contributor [responsivemenu](https://wordpress.org/support/users/responsivemenu/)
 * (@responsivemenu)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-in-2/#post-7565990)
 * Hi there,
 * I finally found a PHP 5.3 server I had from years ago to test on!
 * Can you try editing the main base responsive-menu.php file and add this line 
   below the responsive_menu_deactivation_text function – it needs to go around 
   line 28:
 * if(version_compare(PHP_VERSION, ‘5.4’, ‘<‘))
    return;
 * If that stops the internal server and white screen errors then I will release
   it as a fix.
 * Any questions let me know!
 *  [studioactiv8](https://wordpress.org/support/users/studioactiv8/)
 * (@studioactiv8)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-in-2/#post-7566010)
 * Noticed the update.. just to let you know the message comes up even if I am running
   a higher level of PHP. 5.6 etc.
 * “Responsive Menu requires PHP 5.4 or higher to function and has therefore been
   automatically disabled. You are still on 5.3.5.
    Please speak to your webhost
   about upgrading your PHP version. For more information please visit this page.”
 * I know all this is maddening. I will probably just go ahead and by the Pro. I
   know the technology works great in general 😉
 * thanks
 *  Plugin Contributor [responsivemenu](https://wordpress.org/support/users/responsivemenu/)
 * (@responsivemenu)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-in-2/#post-7566013)
 * Hey there,
 * You dont have PHP 5.6, even the message tells you that you have PHP 5.3.5 installed.
 * You will need to upgrade your PHP Im afraid to use it.
 * All the best
 *  [Patz](https://wordpress.org/support/users/patz/)
 * (@patz)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-in-2/#post-7566028)
 * Oh no!!! Is there anyway I can have a previous version?!! I updated yesterday
   without seeing this…
 * I just need it temporarily – my client wants to move their site over to a completely
   new server which is already running latest apache but it won’t be for about a
   month! Really need this working if pos…
 *  Plugin Contributor [responsivemenu](https://wordpress.org/support/users/responsivemenu/)
 * (@responsivemenu)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-in-2/#post-7566030)
 * Sure, you can get it from the Developers tab on the WordPress plugin main page.
 * You need version 2.8.9

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

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

The topic ‘Parse error: syntax error, unexpected T_FUNCTION in …’ is closed to new
replies.

 * ![](https://ps.w.org/responsive-menu/assets/icon-256x256.png?rev=1782326)
 * [Responsive Menu - Create Mobile-Friendly Menu](https://wordpress.org/plugins/responsive-menu/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/responsive-menu/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/responsive-menu/)
 * [Active Topics](https://wordpress.org/support/plugin/responsive-menu/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/responsive-menu/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/responsive-menu/reviews/)

 * 23 replies
 * 7 participants
 * Last reply from: [responsivemenu](https://wordpress.org/support/users/responsivemenu/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-t_function-in-2/page/2/#post-7566183)
 * Status: resolved