开发者

Problem With Constructors With Parameters In PHP

开发者 https://www.devze.com 2022-12-25 02:27 出处:网络
class MyClass { function __constructor(开发者_运维百科$A,$B,$C) { echo(\"$A $B $C\"); } } $MC=new MyClass(\'Hello\',\'World\',\'!\');
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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消