tags:

views:

26

answers:

1
class MyClass {
  function __constructor($A,$B,$C) {
    echo("$A $B $C");
  }
}
$MC=new MyClass('Hello','World','!');

My parameters don't seem to be making it through to the constructor... Am I doing this wrong?

+5  A: 

Its __construct()

class MyClass {
  function __construct($A,$B,$C) {
    echo("$A $B $C");
  }
}
$MC=new MyClass('Hello','World','!');

http://us2.php.net/manual/en/language.oop5.decon.php#language.oop5.decon.constructor

Chacha102
Daily vote limit reached; Come back in 2 hours.
Pekka
Additionally, if you are used to C++ or C#, you can also use name of the class as the name of constructor.
Ondrej Slinták
Oops! How Embarrassing! Thanks!
Joshua