in a custom plugin I am developing, I am getting this error as soon as I activate the plugin:
Parse error: syntax error, unexpected '[' in /home/site/public_html/wp-content/plugins/my_plugin/plugin.php on line 106
I have hunted down the exact line throwing the fatal error:
$gallery_pictures_id = get_post_meta( $product_id, '_product_image_gallery')[0];
It's worth noting that this line works both in local development and on a staging server.
Why is this happening? What is so weird about it?