admin 发表于 2020-10-22 14:58

php构造函数语法

php构造函数语法
function __construct(){
}代码案例:
<?php
class Student {
        public function __construct() {
                echo '这是构造方法<br>';
        }
}
new Student();        //这是构造方法
new Student();        //这是构造方法
页: [1]
查看完整版本: php构造函数语法