php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #47295 Namespace fall back to global function/constant - computation speed
Submitted: 2009-02-03 20:50 UTC Modified: 2009-11-20 10:11 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: david dot thalmann at gmail dot com Assigned:
Status: Wont fix Package: Documentation problem
PHP Version: Irrelevant OS: Any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: david dot thalmann at gmail dot com
New email:
PHP Version: OS:

 

 [2009-02-03 20:50 UTC] 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-20 10:11 UTC] vrana@php.net
PHP documentation doesn't document PHP internals.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 20:01:29 2024 UTC