Title: Functions causing unexpected [ error
Last modified: April 11, 2018

---

# Functions causing unexpected [ error

 *  Resolved [arielmerrell](https://wordpress.org/support/users/arielmerrell/)
 * (@arielmerrell)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/functions-causing-unexpected-error/)
 * Hi Everyone,
 * Not sure if it was an update or if my host upgraded something, but site will 
   not load and it seems to revolve around this function in the src directory of
   the plugin folder.
 * I patched it just to get the site working by removing that string array, but 
   could someone tell me what it is supposed to be or could something have changed
   on my server that makes this syntax not valid anymore?
 * function hf_human_filesize($size, $precision = 2) {
    for($i = 0; ($size / 1024)
   > 0.9; $i++, $size /= 1024) {} return round($size, $precision).[‘B’,’kB’,’MB’,’
   GB’,’TB’,’PB’,’EB’,’ZB’,’YB’][$i]; }

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

 *  [Danny van Kooten](https://wordpress.org/support/users/dvankooten/)
 * (@dvankooten)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/functions-causing-unexpected-error/#post-10172773)
 * Hi Ariel,
 * Good catch! That function is using the “short array syntax” which is only available
   in PHP versions 5.4 and later. Most likely, your server is running PHP v5.3.x?
 * We’re fixing this in the plugin, but I highly recommend upgrading to PHP 7.2 
   as well. It will greatly speed up and future-proof your site.
 * Cheers, Danny
 *  Thread Starter [arielmerrell](https://wordpress.org/support/users/arielmerrell/)
 * (@arielmerrell)
 * [8 years ago](https://wordpress.org/support/topic/functions-causing-unexpected-error/#post-10232900)
 * Hi Danny,
 * Thanks for the response. We were running PHP 5.4. I found a PHP Selector in our
   cPanel and have selected 7.1. 7.2 is not yet available through my host. All seems
   to be working with that function back to normal.
 * Thanks a bunch. Just starting to really play with the plug-in. Liking it a lot.
 * Kind Regards

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

The topic ‘Functions causing unexpected [ error’ is closed to new replies.

 * ![](https://ps.w.org/html-forms/assets/icon-256x256.png?rev=1754345)
 * [HTML Forms - Simple WordPress Forms Plugin](https://wordpress.org/plugins/html-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/html-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/html-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/html-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/html-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/html-forms/reviews/)

## Tags

 * ["round](https://wordpress.org/support/topic-tag/round/)
 * [functions](https://wordpress.org/support/topic-tag/functions/)
 * [Unexpected](https://wordpress.org/support/topic-tag/unexpected/)

 * 2 replies
 * 2 participants
 * Last reply from: [arielmerrell](https://wordpress.org/support/users/arielmerrell/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/functions-causing-unexpected-error/#post-10232900)
 * Status: resolved