Solved

syntax error

Posted on 2013-06-07
7
338 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
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
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 dynamically set the form action using jQuery.

688 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