Solved

unexpected T_VARIABLE php

Posted on 2003-11-08
2
678 Views
Last Modified: 2010-04-06
Im new to Classes in PHP and have a rather odd problem.  Im getting an unexpected T_VARIABLE error.  I've checked, double checked and triple checked any missing semi-colons, comas, etc and still nothing.  Here is the code snipit:

Here is where I get the error:
(d is of type Directions and places is an array of Route objects)

echo "$d->getRoute($i)->getName()";
if($dir == $d->getRoute($i)->getName())
{
  echo "orange_text";
}

// code snippets
class Directions{
  function getRoute($i){
    return $this->places[$i];
  }
}

class Route{
    function getName(){
    return $this->name;
  }
}
0
Comment
Question by:elbarro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

by:
Zontar earned 500 total points
ID: 9708895
Is this the complete code? I don't see any class constructors or calls to them.
0
 

Author Comment

by:elbarro
ID: 9709026
I answered my question.  Turns out i did indeed make an error. Thanks for your help
0

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question