【发布时间】:2011-10-15 22:04:34
【问题描述】:
__construct 函数和类同名函数有区别吗?
class foo {
function foo ($something){
echo "I see ".$something." argument";
}
}
class bar {
function __construct ($something){
echo "<br />
I see ".$something." argument again";
}
}
$foo = new foo("foo");
$bar = new bar("bar");
【问题讨论】:
-
查看这个问题的接受答案stackoverflow.com/questions/455910/…
-
谢谢艾莉森。应要求将问题标记为重复问题的人发布原始问题。
标签: php class function constructor