What's better at freeing memory with PHP: unset() or $var = null

前端 未结 13 2269
陌清茗
陌清茗 2020-11-22 08:57

I realise the second one avoids the overhead of a function call (update, is actually a language construct), but it would be interesting to know if one is be

13条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 09:54

    PHP 7 is already worked on such memory management issues and its reduced up-to minimal usage.

    
    

    PHP 7.1 Outpu:

    took 0.16778993606567 seconds took 0.16630101203918 seconds

提交回复
热议问题