Home > Backend Development > PHP Tutorial > php unset()详解

php unset()详解

WBOY
Release: 2016-06-23 14:35:02
Original
1326 people have browsed it

简介:这是php unset()详解的详细页面,介绍了和php,unset, php php unset()详解有关的知识、技巧、经验,和一些php源码等。

class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=361000' scrolling='no'> 1.如果有多个变量名指向某一个变量值,unset任何一个变量名只是断开变量名和变量值之间的关系,不会释放内存,该值还存在
   (例外见2).
2.两种情况会释放内存,否则内存中该变量值还存在.
   a)该变量值占用空间超过256字节的时候用unset()才会释放内存(这是有人的测试结果,待解释)
   b)当指向该值的所有变量(比如有引用变量指向该值)都被销毁后
3.如果想释放变量内存,最好用$a=NULL释放,当赋于NULL值时,该地址被释放,所有指向该变量值的引用都为空了
4.当在局部环境unset全局变量时,该全局变量只是在局部作用域失效.在其他地方不变

爱J2EE关注Java迈克尔杰克逊视频站JSON在线工具

http://biancheng.dnbcw.info/php/361000.html pageNo:1
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template