Can I close a file by unsetting the handle?

前端 未结 4 1002
闹比i
闹比i 2020-12-18 06:47

I\'m a little puzzled if I can spare the fclose command by just unsetting the variable that carries the handle?

$handle = fopen($file);
...
fclo         


        
4条回答
  •  情深已故
    2020-12-18 07:21

    some research:

    fclose makes $handle to be resource(5) of type (Unknown) while

    unset makes it NULL.

    and after fclose php consumes 88 bytes of memory more.

    so: they are different =)

提交回复
热议问题