Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

syntax error

Posted on 2013-06-07
7
Medium Priority
?
341 Views
Last Modified: 2013-06-12
Hi,

I get a syntax error in the following script.

<?php

class STLStats
{

      public function getWeight(){
        $volume = $this->getVolume("cm");
        $weight = $this->calculateWeight($volume);
        return $weight;
    }

}


?>

please help me to solve it.

ayha
0
Comment
Question by:ayha1999
[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
7 Comments
 
LVL 31

Expert Comment

by:Marco Gasi
ID: 39229243
Can you tell what is the error message, please?
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 336 total points
ID: 39229253
Where are the definitions of getVolume and calculateWeight?
0
 
LVL 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 332 total points
ID: 39229619
There is no syntax error in this at all:
<?php

class STLStats
{

      public function getWeight(){
        $volume = $this->getVolume("cm");
        $weight = $this->calculateWeight($volume);
        return $weight;
    }

}


?>

Open in new window

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 2

Assisted Solution

by:aviran
aviran earned 332 total points
ID: 39229761
The code seems fine, meaning the cause for the error is in the part of the code you did not put here.

maybe in getVolume() or calculateWeight()
0
 
LVL 31

Expert Comment

by:Marco Gasi
ID: 39229777
Please, post the full code and specify the exact error message: this way you'll can get a better help than leaving us to trry to guess the root of evil ;)
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 39229788
What marqusG wrote, +1.  In particular, please follow the guidance of the SSCCE (it will really save you a lot of time and confusion if you read it and practice it).
0
 
LVL 7

Author Closing Comment

by:ayha1999
ID: 39241456
Missing functions only.

Thanks
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

610 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