• 实例首页
  • 自学教程
  • IT工具箱
xxxxxxxxxx
 
1
<?php
2
class MyDestructableClass
3
{
4
    public $name = '';
5
    function __construct()
6
    {
7
        print "构造函数<br />";
8
        $this->name = "MyDestructableClass";
9
    }
10
​
11
    function __destruct()
12
    {
13
        print "销毁 " . $this->name . "<br />";
14
    }
15
}
16
​
17
$obj = new MyDestructableClass();
18
​

© 2023 自学教程   runoops.com All Rights Reserved. 备案号:闽ICP备19010956号-1