Title: Parse error: syntax error, unexpected &#8216;function&#8217; (T_FUNCTION)
Last modified: September 15, 2018

---

# Parse error: syntax error, unexpected ‘function’ (T_FUNCTION)

 *  [amoralutero](https://wordpress.org/support/users/amoralutero/)
 * (@amoralutero)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-function-t_function-3/)
 * Hi, right now I have this error on my website:
 * Parse error: syntax error, unexpected ‘function’ (T_FUNCTION), expecting while(
   T_WHILE) in /home2/hatha/public_html/libertadfemenina.com/wp-includes/plugin.
   php on line 623
 * It happened after I made a backup on my website redirected the domain. The php
   version my hosting provider is running is 5.6
 * This are the lines of code:
 * function has_action($tag, $function_to_check = false) {
    return has_filter($tag,
   $function_to_check); }
 * I appreciate any help!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fparse-error-syntax-error-unexpected-function-t_function-3%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [Radu](https://wordpress.org/support/users/broseph/)
 * (@broseph)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-function-t_function-3/#post-10691040)
 * Hello!
 * Your outdated PHP version can be one cause.
 * Your theme or a plugin is trying to use more advanced PHP features which you 
   don’t have because you’re on PHP 5.6.
 * Updating your PHP version might fix this and other future issues.
 * But someone with web development experience might have another fix for you.
 * That’s the only one that I can think about.
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [7 years, 8 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-function-t_function-3/#post-10691128)
 * This may be a plugin or theme conflict. Please attempt to disable all plugins,
   and use one of the default (Twenty*) themes. If the problem goes away, enable
   them one by one to identify the source of your troubles.
 * If you can install plugins, install “Health Check”: [https://wordpress.org/plugins/health-check/](https://wordpress.org/plugins/health-check/)
   On the troubleshooting tab, you can click the button to disable all plugins and
   change the theme for you, while you’re still logged in, **without affecting normal
   visitors to your site**. You can then use its admin bar menu to turn on/off plugins
   and themes one at a time.
 * See [http://www.wpbeginner.com/plugins/how-to-deactivate-all-plugins-when-not-able-to-access-wp-admin/](http://www.wpbeginner.com/plugins/how-to-deactivate-all-plugins-when-not-able-to-access-wp-admin/)
 *  Thread Starter [amoralutero](https://wordpress.org/support/users/amoralutero/)
 * (@amoralutero)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-function-t_function-3/#post-10693628)
 * Hi! Thanks for your replies, I will try it and be back to let you know how it
   worked out.
 *  Thread Starter [amoralutero](https://wordpress.org/support/users/amoralutero/)
 * (@amoralutero)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-function-t_function-3/#post-10693644)
 * Unfortunately, deactivating the plugins through FTP using the wpbeginner guide
   didn’t allow me to log in to my WordPress dashboard, I still see the exact same
   error on the screen…
 * I haven’ tried the PHP upgrade. Should I ask my host for this? Or it’s something
   I can do on my own?
 * I really appreciate your help.🙏🏽
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [7 years, 8 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-function-t_function-3/#post-10693680)
 * Also reset your theme — just rename the active theme’s folder to something to
   forxe WP to use a default theme.
 *  [Radu](https://wordpress.org/support/users/broseph/)
 * (@broseph)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-function-t_function-3/#post-10700121)
 * The safest way is to talk to your host, not to do it alone. They might not allow
   you to upgrade the PHP version or they might not even support a higher version.
 * Reset your theme first, though, as pointed out above. See if that works.
 * Perform a full website backup before asking your host about the PHP upgrade.

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

The topic ‘Parse error: syntax error, unexpected ‘function’ (T_FUNCTION)’ is closed
to new replies.

## Tags

 * [plugin.php](https://wordpress.org/support/topic-tag/plugin-php/)
 * [syntax error](https://wordpress.org/support/topic-tag/syntax-error/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 3 participants
 * Last reply from: [Radu](https://wordpress.org/support/users/broseph/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-function-t_function-3/#post-10700121)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
