?
Solved

syntax error

Posted on 2013-06-07
7
Medium Priority
?
339 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
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 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

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

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 dynamically set the form action using jQuery.
Suggested Courses

770 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