Solved

unexpected T_VARIABLE php

Posted on 2003-11-08
2
655 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
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP radio buttons with email not sending 24 100
Form submit issue 11 85
JQuery tracking event. 3 67
Questions about this React unit test 4 63
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 …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will learn how to count occurrences of each item in an array.
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.

773 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