I keep getting Fatal error: Call to undefined function newMyOperatorClass() in C:\wamp\www\KanJ_PHP_Website\KanJ_PHP_Ex2.php on line 17.....here is my code...

<html>
    <head>
        <title>Justin Kangley Ex2</title>
    </head>

    <body>
        <?php

        class MyOperatorClass
        {
            private $rValue; //declare private property at the class level so all the functions use it

            //default constructor method (same name as class but no parameters/values passed to the method)
            public function MyOperatorClass()
            {
                //this is the PHP approach to setting class properties
                $this->rValue = 0.0;
            }

            public function add($num1, $num2)
            {
                $rValue = $num1 + $num2;
                return $rValue;
            }

            public function subtract($num1, $num2)
            {
                $rValue = $num1 - $num2;
                return $rValue;
            }

            public function multiply($num1, $num2)
            {
                $rValue = $num1 * $num2;
                return $rValue;
            }

            public function divide($sum1, $sum2)
            {
                $rValue = $sum1 / $sum2;
                return $rValue;
            }

            public function modulus($sum1, $sum2)
            {
                $rValue = $sum1 % $sum2;
                return $rValue;
            }

            public function increment($sum1)
            {
                $sum++;
                return $sum1;
            }

            public function decrement($sum1)
            {
                $sum1--;
                return $sum1;
            }
        }

        ?>
    </body>

</html>

Never mind I forgot to put a space in part of my code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.