PHP 5.3 Namespaces should i use every PHP function with backslash?

天大地大妈咪最大 提交于 2019-12-09 02:31:42

问题


im now using namespaces in PHP 5.3 now there is a fallback mechanism for functions which dont exist in the namespace. so php every time checks if the function exists in namespace and then tries to load it from global space.

So what about all php internal functions? strstr for example? Should i now use every php internal function with a \ ? to avoid php first checking the namespace? is this fallback a huge performance drop? what do you think?


回答1:


No matter the performance hit, no way should you do that. Ew, ew, ew. Any performance boost there may be is not worth your sanity.



来源:https://stackoverflow.com/questions/2709375/php-5-3-namespaces-should-i-use-every-php-function-with-backslash

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!