#47295 [Opn->WFx]: Namespace fall back to global function/constant - computation speed
ID: 47295
Updated by: vrana@php.net
Reported By: david dot thalmann at gmail dot com
-Status: Open
+Status: Wont fix
Bug Type: Documentation problem
Operating System: Any
PHP Version: Irrelevant
New Comment:
PHP documentation doesn't document PHP internals.
Previous Comments:
------------------------------------------------------------------------
[2009-02-03 20:50:17] david dot thalmann at gmail dot com
Description:
------------
Hello!
As mentioned in the documentation[1]: "PHP will fall back to global
functions or constants if a namespaced function or constant does not
exist". A "fall back" implies (?) more computation (in this case going
through the priority list) which further implies a loss of
speed/performance.
It should be mentioned in the doc - if my assumption is true (based on
a excerp of the internals-mailinglist[2]), that calling a built in
function fully qualified (\built_in_function()) should be prefered over
unqualified (built_in_function()).
I know, this is just a small note to the doc, but built-in functions
are used very often, so this could bring a lot of speed on medium to
large projects.
May add this to the doc when 5.3 is out and/or when it's clear how,
what and when a fallback will be used (see discussion[3]).
Regards
David
[1] http://www.php.net/namespaces.fallback
[2] http://news.php.net/php.internals/41696
[3] http://wiki.php.net/rfc/namespaceresolution
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47295&edit=1
Thread (2 messages)