Solved

syntax error

Posted on 2013-06-07
7
336 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 84 total points
ID: 39229253
Where are the definitions of getVolume and calculateWeight?
0
 
LVL 110

Assisted Solution

by:Ray Paseur
Ray Paseur earned 83 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Assisted Solution

by:aviran
aviran earned 83 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 110

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

726 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