Are namespaces bad for performance? (PHP)

I've made some changes for a php framework to suport namespaces and the result wasn't as expected. For a simple test (mostly framework classes loaded) the execution time slowed down with ~10%.

From your experience, is it worth it to use namespaces on large apps (considering the actual development level of PHP)?


The accepted answer on php namespace benchmark is a good way of looking at this.

I would use namespaces in pretty much any OO application I write in PHP now, it saves a lot of headaches (especially in larger projects) with clashing names. You just need to be aware of the limitations of namespaces in PHP.

http://www.php.net/manual/en/language.namespaces.faq.php

链接地址: http://www.djcxy.com/p/10416.html

上一篇: 如何在Android中使用Ontouchevent突出显示此pdf页面

下一篇: 命名空间对性能不利? (PHP)