为什么在PHP中,名称空间使用反斜杠()来分隔文件夹?
例如:
namespace Core\fruit\Apple;
是否有任何特殊原因?
我觉得反斜杠惯例是不合逻辑的,因为unix / linux文件系统使用正斜杠.但是我的观点不对.
解决方法:
Criterions
(1) type-ability (how easy is it to type the separator)
(2) typo-vulnerability (how easy is it to make a typo and get an unwanted behavior without a error/warning)
(3) parse-ability (how easy is it to read the code and figure out whats going on without getting confused with similar syntax that means another thing)
(4) IDE compatibility
(5) number of chars
标签:standards,php
来源: https://codeday.me/bug/20191122/2063684.html