有关php unset函数的问题 [英] Questions about php unset function

查看:62
本文介绍了有关php unset函数的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对取消设置

  1. 如何取消设置所有变量.我应该使用 unset($ var1,$ var2,$ var3,...)还是存在其他任何简单方法?
  2. 在函数末尾重置变量是一种好习惯?有什么区别!
  3. 是否将变量设置为 reduce 编程 execution time 还是不?
  1. How to unset all variables.should i use unset($var1,$var2,$var3,...) or any other easy method exists ?
  2. unseting the variables at the end of functions is good practice?.any difference !
  3. unseting the variable is will reduce programming execution time or not ?

谢谢

推荐答案

  1. 您的意思是 unset($ var1,$ var2,$ var3,...)对您来说还不容易吗?

没有必要明确地这样做,因为局部变量将始终在函数作用域的末尾消失.这也适用于引用变量,只有函数本地的引用会消失,但是如果引用超出了函数范围,它们仍然会存在.

There's no point to doing so explicitly since local variables will always disappear at the end of a function's scope. This applies to reference variables too, only the references local to the function will disappear, but whatever they reference, if outside the function scope, will still be there.

不知道.

这篇关于有关php unset函数的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆