0

I just moved WordPress website from Dev Environment to Production Hosting Environment. The first one is Windows Dev, the second is Linux Managed Hosting (only management panel + ftp). All works as expected without sites that has in their custom code line like this:

<?php echo get_field_object('social')['label']; ?>

This code is used by plug-in Advanced Custom Fields. On my Dev thre is no problem with this, hoverer on production I get this error:

Parse error: syntax error, unexpected '[', expecting ',' or ';' in 
/var/sites/m/domain.name/public_html/wp-content/themes/m30pl/single-facylitator.php on line 21

Mentioned line is that I presented above. I have no idea what might be wrong, on production server PHP version is 5.3.

Any ideas what may be wrong?

  • 3
    The array dereferencing from function calls `get_xy("123")["key"]` does work from PHP 5.4 onwards. – mario Feb 20 '13 at 02:16

1 Answers1

2

you got PHP version difference...You code will work on 5.4+ version...

Zaffar Saffee
  • 6,167
  • 5
  • 39
  • 77