Solved

unexpected T_VARIABLE php

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
css help 3 93
Coova-Chilli can't work with URL using HTTPS! 3 106
replace quotes with UTF-8 character 38 69
Problem to picture file 3 42
Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now