is_file/file_exists performance and cache

后端 未结 3 1054
野的像风
野的像风 2021-02-09 09:21

I made some tests to compare and measure speed of both functions. is_file seems to be several times faster (I used 10000 iterations for both) than file_

3条回答
  •  北恋
    北恋 (楼主)
    2021-02-09 10:22

    is_file and file_exists are two different function that does two different things; file_exists only check if the file exists, is_file tell if the target is a valid file, and (for example) not a directory.

    They shouldnt be used for the same goal, so the performance comparison cant be done (imho)

提交回复
热议问题