On Wed, 2013-10-02 at 23:01 -0400, William Bartlett wrote:
> My understanding is that the const triggers some optimizations because the
> compiler better understands how the variables are used.

There's not really much win. In most cases the generated code is exactly
the same.*) Such changes are nice to spot bugs as the compiler has more
knowledge of the intention and to make C++ compilers happy when using
these APIs as C++ is stricter on const.

johannes

*) there are few cases where this helps with inlining or passing params
via register, but here we mostly deal with exported APIs which have to
follow the platforms ABI rules.


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to