Is there garbage collection in PHP?

后端 未结 5 610
南笙
南笙 2020-11-27 16:32

I know that in PHP you don\'t have to free memory. Is it reached by garbage collector?

5条回答
  •  时光说笑
    2020-11-27 16:56

    PHP has a combination of garbage collection and reference counting. The latter is the main mode of managing memory, with the garbage collector picking up the pieces that the ref counter misses (circular references). Before 5.3, php only had ref-counting, and even in 5.3 it's the still how memory will usually be freed.

提交回复
热议问题