The following function in my Wordpress functions.php file
405 function get_first_name($full_name) {
406 return explode(" ",$full_name)[0];
407 }
works fine on my test server, but as soon as I move it to the test server it causes this error:
Parse error: syntax error, unexpected '[' in ...functions.php on line 406
Actual file location removed for brevity and security.
This is a very common error which usually means you've forgotten a closing bracket, quote etc. However, I can't see anything like that missing here, and also if that were the case it'd would also error on my test server.
Could it be something further up the in the code - this is the last function on the page?