Title: Parse Error
Last modified: August 24, 2016

---

# Parse Error

 *  [Iolanda](https://wordpress.org/support/users/chaosroad/)
 * (@chaosroad)
 * [11 years ago](https://wordpress.org/support/topic/parse-error-331/)
 * I’d like to use your plugin. But every time I try to activate, it generates a
   fatal error which says:
 * > Parse error: syntax error, unexpected ‘[‘ in /.…../wp-content/plugins/wp-infinite-
   > scrolling/wp-infinite-scrolling.php on line 22
 * How can I resolve?
    Thanks!
 * [https://wordpress.org/plugins/wp-infinite-scrolling/](https://wordpress.org/plugins/wp-infinite-scrolling/)

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

 *  [lilianneb](https://wordpress.org/support/users/lilianneb/)
 * (@lilianneb)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/parse-error-331/#post-6173479)
 * Hi I’m seeing the same message when I try to activate the plugin: unexpected ‘[‘
   in /.…../wp-content/plugins/wp-infinite-scrolling/wp-infinite-scrolling.php…
 *  [lovinawordpress](https://wordpress.org/support/users/lovinawordpress/)
 * (@lovinawordpress)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/parse-error-331/#post-6173481)
 * Hi I’m seeing the same message when I try to activate the plugin: unexpected ‘[‘
   in /.…../wp-content/plugins/wp-infinite-scrolling/wp-infinite-scrolling.php…
 *  [HappyKite](https://wordpress.org/support/users/happykite/)
 * (@happykite)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/parse-error-331/#post-6173490)
 * Hi,
 * I’m not sure if any of you are still having this issue, but I have a couple of
   solutions for you to try.
 * There is a function in this plugin that relies on array dereferencing, This is
   a function that was introduced in PHP 5.4. Your best way to fix this is to contact
   your hosting provider and ask them to upgrade your servers version of PHP to 
   at least 5.4.
 * If you are unable to do that, or your hosting provider will not let you, then
   unfortunately you will need to modify the core plugin files, which normally isn’t
   recommended.
 * In the plugin there will be a file called ‘wp-infinite-scrolling.php’. On line
   23 there will be the below function:
 *     ```
       function wpifs_option( $key ) {
         return get_option( "wpifs_{$key}", wpifs_defaults()[$key] );
       }
       ```
   
 * This is where the issue is, the way the get_option array is written is perfect
   and will work for PHP versions of 5.4 and higher. However if you want this to
   work with older versions of PHP (and newer ones for that matter) then you will
   need to change it to the below:
 *     ```
       function wpifs_option( $key ) {
         return get_option( "wpifs_{$key}", wpifs_defaults($key) );
       }
       ```
   
 * Hope that helps!

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

The topic ‘Parse Error’ is closed to new replies.

 * ![](https://ps.w.org/wp-infinite-scrolling/assets/icon-128x128.png?rev=1159616)
 * [WP Infinite Scrolling](https://wordpress.org/plugins/wp-infinite-scrolling/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-infinite-scrolling/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-infinite-scrolling/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-infinite-scrolling/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-infinite-scrolling/reviews/)

 * 3 replies
 * 4 participants
 * Last reply from: [HappyKite](https://wordpress.org/support/users/happykite/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/parse-error-331/#post-6173490)
 * Status: not resolved