燕十八php垃圾回收机制学习之第一天
来源:互联网 发布:nginx load module 编辑:程序博客网 时间:2024/05/16 01:08
<?php
/****
燕十八 公益php讲堂
论坛:http:/www.zixue.it
微博:http:/weibo.com/Yshiba
YY频道:88354001
****/
class Human{
public $name='张三';
public $gender=NULL;
public function __destruct(){
echo '死了!<br />';
}
}
$e=$f=$g=new Human();
unset($e);
echo'unset e <br />';
unset($f);
echo 'unset f <br />';
unset($g);
//执行到这里的时候,马上回去执行了析构销毁对象
echo 'unset g <br />';
unset $e; unset $f;再来unset$g,还没有来得及执行 echo 'unset g <br />';这条语句就执行了类中
的析构函数了。所以会打印出来一个 死了,在unset g 之前。
当一个object没有对像指向它时,它马上执行析构函数。
unset e
unset f
死了!
unset g
/****
燕十八 公益php讲堂
论坛:http:/www.zixue.it
微博:http:/weibo.com/Yshiba
YY频道:88354001
****/
class Human{
public $name='张三';
public $gender=NULL;
public function __destruct(){
echo '死了!<br />';
}
}
$e=$f=$g=new Human();
unset($e);
echo'unset e <br />';
unset($f);
echo 'unset f <br />';
unset($g);
//执行到这里的时候,马上回去执行了析构销毁对象
echo 'unset g <br />';
unset $e; unset $f;再来unset$g,还没有来得及执行 echo 'unset g <br />';这条语句就执行了类中
的析构函数了。所以会打印出来一个 死了,在unset g 之前。
当一个object没有对像指向它时,它马上执行析构函数。
unset e
unset f
死了!
unset g
- 燕十八php垃圾回收机制学习之第一天
- PHP垃圾回收机制之回收周期
- 又学习一点php垃圾回收机制之simple_html_dom库
- PHP垃圾回收机制之引用计数
- php内存管理之垃圾回收机制
- php垃圾回收机制
- php垃圾回收机制
- PHP 垃圾回收机制
- php垃圾回收机制
- PHP垃圾回收机制
- PHP 垃圾回收机制
- 【PHP】垃圾回收机制
- PHP垃圾回收机制
- PHP垃圾回收机制
- PHP 垃圾回收机制
- PHP 垃圾回收机制
- PHP 垃圾回收机制
- PHP 垃圾回收机制
- A. Lunch Rush
- Understanding the Request Processing Lifecycle Phases
- JDBC连接SQL Server2005错误:通过端口 1433 连接到主机 localhost 的 TCP/IP 连接失败
- boost库在工作(15)绑定器与函数对象之三
- ubuntu中软件安装相关知识(deb、dpkg、apt-get)
- 燕十八php垃圾回收机制学习之第一天
- LR检查点
- JavaScript如何实现3秒自动跳转
- solr 4.1 怎么开启suggest
- Solr查询相识度最高排序
- chkconfig命令
- 真正的开始
- ClassNotFoundException HttpRequestInterceptor
- 图形软件ichartjs与hightchar的优点