My First PHP OOP's Programme or Project - Calculate: add, subtract or Multiply

Yep. The names are not important. No link between the two. Heck, you could even do this:

class Calc {
    private $num1;
    private $num2;
    private $cal;

    public function __construct($arg1, $arg2, $arg3) {
        $this->num1 = $arg1;
        $this->num2 = $arg2;
        $this->cal = $arg3;
    }

Not recommended but it would work.

And please stop using tabs. Have your IDE expand tabs into spaces.

1 Like