Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

unexpected T_VARIABLE php

Posted on 2003-11-08
2
Medium Priority
?
692 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 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
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…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

824 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