Why do I need `fclose` after writing to a file in PHP?

前端 未结 7 944
囚心锁ツ
囚心锁ツ 2020-12-29 03:44

Why do I need to finish by using the fclose($handle) function after writing to a file using php? Doesn\'t the program automatically do this when it ends?

7条回答
  •  自闭症患者
    2020-12-29 04:02

    Except when the program doesn't end or takes long, it counts towards maximum open file handles in the system. But yes, PHP allows for laziness.

提交回复
热议问题