且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

(Pathinfo vs fnmatch第2部分)Windows和Mac上的速度基准颠倒了

更新时间:2023-02-01 17:54:55

我们为什么要得到这两种不同 结果?

Why do we get these two different results?

fnmatch应该映射到操作系统的基础fnmatch命令(Windows没有这样的命令,并且直到PHP 5.3才可用).苹果执行该命令的速度必须较慢.

fnmatch should be mapped to the OS's underlying fnmatch command (Windows has no such command and was unavailable until PHP 5.3). Apple's implementation of the command must be less speedy.

这可以适用于其他功能吗?

Could this apply to other functions?

您可以检查 glob()来解决速度问题还对文件名执行正则表达式.

You could check glob() for speed issues as it also performs regex on filenames.

编辑:Glob不进行正则表达式.好吧,世界. (感谢salathe)

Glob does not regex. It, well, globs. (thanks to salathe)