PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, July 26, 2022

[FIXED] Why does dreamweaver show an error on this line when the code is valid

 July 26, 2022     dreamweaver, php     No comments   

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)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing