I have a class
<?php class Test{ public function printword($word){ echo $word; } } ?> And in another class, i call it.
<?php //Included needed files !!! $w = 'Hello'; //Way 1 $a = new Test; $result = $a->printword($w); //Way 2 $result = Test::printword($w); ?> Is it different ?
And $a = new Test; or $a = new Test(); is right ?
->. And $a = new Test; or $a = new Test(); is right ? Both. If you want to pass arguments to the constructor then of course you have to write the parentheses.