标签:
· 在类中,如果希望类是用参数构造的,可以在类中用一个与类同名的function即可,如下代码
class Point2D { var $x, $y; function Point2D($x, $y) { $this->x = $x; $this->y = $y; } } $p1 = new Point2D(1.233, 3.445);
php技巧
原文地址:http://www.cnblogs.com/kenway/p/4261390.html