I’m getting this warning, but the correct value is getting returned, is there any way to do something to fix it so there aren’t any warnings (see two screenshots below) — the array for sizes is being returned but I still get the warning:
I’m also getting this error ever since I’ve updated to PRO.
$img = get_field('gallery')[0]['image'];
Is throwing the error: Illegal string offset “image”
PHP 5.4.34
I ran into a similar problem which I worked around with extract(). But with extract() there are some security considerations, so please read up on the link below before implementing.
http://php.net/manual/en/function.extract.php
EDIT:
Another good resource on extract()
http://stackoverflow.com/questions/829407/what-is-so-wrong-with-extract
Hope this helps 🙂