Title: Parse error: syntax error, unexpected &#039;[&#039; in ./Classes/Options.php on line 38
Last modified: August 31, 2016

---

# Parse error: syntax error, unexpected '[' in ./Classes/Options.php on line 38

 *  Resolved [erum1973](https://wordpress.org/support/users/erum1973/)
 * (@erum1973)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-in-classesoptionsphp-on-line-38/)
 * I just upgraded the plugin to version 2.0.0 and immediately I got the mentioned
   syntax error on the following function in Options.php:
    ` public function get_option(
   $option_name ) { if (! $this->has_option( $option_name ) ) { return $this->get_defaults()[
   $option_name]; }
 *  return $this->options[$option_name];
    }
 * Line 38 is the then statement there in the middle.
 * [https://wordpress.org/plugins/php-code-for-posts/](https://wordpress.org/plugins/php-code-for-posts/)

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

 *  Plugin Author [Jamie Fraser](https://wordpress.org/support/users/thejfraser/)
 * (@thejfraser)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-in-classesoptionsphp-on-line-38/#post-7155906)
 * Hi Erum!
 * Good Catch.
 * It looks like an incompatibility with the version of PHP you are using.
 * I’m pushing a fix now which should correct the issue.
 * I’ve tested this on 5.5.8 and 5.6.17.
 * cheers
 *  [sergeinovik](https://wordpress.org/support/users/sergeinovik/)
 * (@sergeinovik)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-in-classesoptionsphp-on-line-38/#post-7155936)
 * Heh, just found the same issue and got here 🙂
 * Looking forward to resolution.
 * Best,
 * S.

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

The topic ‘Parse error: syntax error, unexpected '[' in ./Classes/Options.php on
line 38’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/php-code-for-posts_0d1022.svg)
 * [PHP Code for posts](https://wordpress.org/plugins/php-code-for-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/php-code-for-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/php-code-for-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/php-code-for-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/php-code-for-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/php-code-for-posts/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [sergeinovik](https://wordpress.org/support/users/sergeinovik/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-in-classesoptionsphp-on-line-38/#post-7155936)
 * Status: resolved