消耗内存用的
消耗服务器内存用的代码片。
消耗服务器内存用的代码片。
<?php
class Foo {
function __construct()
{
$this->bar = new Bar($this);
}
}
class Bar {
function __construct($foo = null)
{
$this->foo = $foo;
}
}
while (true) {
$foo = new Foo();
unset($foo);
echo number_format(memory_get_usage()) . "/n";
}
?>
- 上一篇:PHP获取访客IP和地理位置等信息的类
- 下一篇:PHP Entity
精彩图集
精彩文章






