Title: PHP Parse error: syntax error, unexpected T_FUNCTION in
Last modified: September 20, 2017

---

# PHP Parse error: syntax error, unexpected T_FUNCTION in

 *  Resolved [dkilgoesc13](https://wordpress.org/support/users/dkilgoesc13/)
 * (@dkilgoesc13)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/php-parse-error-syntax-error-unexpected-t_function-in/)
 * After updating to 1.4.1, I can’t log into my site and see this error in my php.
   log
    [20-Sep-2017 13:58:30] PHP Parse error: syntax error, unexpected T_FUNCTION
   in /xxxxxxx/wp-content/plugins/disable-json-api/classes/disable-rest-api.php 
   on line 86
 *  /**
    * Checks a route for whether it belongs to the whitelist * * [@param](https://wordpress.org/support/users/param/)
   $currentRoute * * [@return](https://wordpress.org/support/users/return/) boolean*/
   private function is_whitelisted( $currentRoute ) {
 *  return array_reduce( $this->get_route_whitelist_option(), function ( $isMatched,
   $pattern ) use ( $currentRoute ) {
    return $isMatched || (bool) preg_match( ‘
   @^’ . htmlspecialchars_decode( $pattern ) . ‘$@i’, $currentRoute ); }, false );
 *  }
 * I looks like this plugin is now using closures which aren’t compatible with my
   really old php install. (5.2.x)
 * Could you make use of the recently added php version feature and note which php
   versions are supported?
 * [https://wptavern.com/wordpress-org-now-allows-plugin-authors-to-specify-a-minimum-php-version-requirement](https://wptavern.com/wordpress-org-now-allows-plugin-authors-to-specify-a-minimum-php-version-requirement)

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

 *  Plugin Author [Dave McHale](https://wordpress.org/support/users/dmchale/)
 * (@dmchale)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/php-parse-error-syntax-error-unexpected-t_function-in/#post-9513724)
 * Hi [@dkilgoesc13](https://wordpress.org/support/users/dkilgoesc13/)
 * Sorry to hear about your issue. However, I *did* add the PHP version requirement
   in the release, and the plugin page in the repository shows that 5.3+ is required.
   The info is located in the rightbar just above the “Tags” section.
 * [https://wordpress.org/plugins/disable-json-api/](https://wordpress.org/plugins/disable-json-api/)
 *  [kejohnso](https://wordpress.org/support/users/kejohnso/)
 * (@kejohnso)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/php-parse-error-syntax-error-unexpected-t_function-in/#post-9613578)
 * I’m getting the same error. How do I fix it?
 *  Plugin Author [Dave McHale](https://wordpress.org/support/users/dmchale/)
 * (@dmchale)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/php-parse-error-syntax-error-unexpected-t_function-in/#post-9613690)
 * [@kejohnso](https://wordpress.org/support/users/kejohnso/)
 * Upgrade to PHP 5.3 or higher, or downgrade this plugin to version 1.3. I _strongly_
   recommend the first option though 🙂

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

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

 * ![](https://ps.w.org/disable-json-api/assets/icon-256x256.png?rev=1001011)
 * [Disable REST API](https://wordpress.org/plugins/disable-json-api/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/disable-json-api/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/disable-json-api/)
 * [Active Topics](https://wordpress.org/support/plugin/disable-json-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/disable-json-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/disable-json-api/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Dave McHale](https://wordpress.org/support/users/dmchale/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/php-parse-error-syntax-error-unexpected-t_function-in/#post-9613690)
 * Status: resolved