【发布时间】:2015-02-02 00:33:36
【问题描述】:
我知道一些在 PHP 中重置变量的方法。
问题是我不知道到底有什么区别 他们和谁更快,所以我在这里问...
有什么区别:
<?php
$resetME = null;
//VS
unset($resetME);
//VS
$resetME = 0;
?>
还有……
我很高兴知道是否有其他技巧可以完全从内存中删除变量。
此外,我很想知道是否有任何理由重置页面末尾的变量,因为服务器在页面完全加载时无论如何都会重置它们......
只是为了澄清更多......
<?php
$a = 1;
echo $a;
//is there any reason to unset $a on the end of the page ?
unset($a);
?>
提前致谢!
【问题讨论】:
标签: php string variables null unset