Solved

syntax error

Posted on 2013-06-07
7
333 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
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 109

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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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 109

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
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…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

825 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