Issue
Why does Dreamweaver show a red error on this line
<?php $pt=$test->Terms()['Terms'];?>
The line is perfectly valid and runs, and does what it is supposed to do, and yet dreamweaver insists that it is an error.
I have a function returning a named array you see, and it works fine on the page.
Solution
You are directly accessing an array key of a function result. Array dereferencing of function results was implemented in PHP 5.4. See http://php.net/manual/en/language.types.array.php
I'd guess that the syntax checking of Dreamweaver uses a version of PHP < 5.4.
Answered By - bspellmeyer Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.