且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我应该在php __destruct()中使用unset吗?

更新时间:2022-06-17 05:49:17

您真的不需要担心清理PHP中的变量声明,它的垃圾回收会为您处理所有这些事情.您的__destruct()方法主要用于关闭持久连接.

You really don't need to worry about cleaning up your variable declarations in PHP, its garbage collection takes care of all of that for you. Your __destruct() methods are primarily for things like closing persistent connections.