php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #34789 userland naming guide
Submitted: 2005-10-08 12:51 UTC Modified: 2006-08-11 16:41 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: lsmith@php.net Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: irrlevant
Private report: No CVE-ID: None
 [2005-10-08 12:51 UTC] lsmith@php.net
Description:
------------
We need a guide that explains users how to name their userland functions, classes, exceptions etc without conflicting with future versions of php (or atleast keeping the risk low) ..

so we will state the obvious like that we usually prefix extension stuff with the name of the extensions .. but also that we postfix iterators and exceptions with "Iterator" and "Exception" ..


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-13 11:49 UTC] vrana@php.net
In language/oop.xml is already mentioned this:

"PHP reserves all function names starting with __ as magical. It is recommended that you do not use function names with __ in PHP unless you want some documented magic functionality."
 [2005-11-25 09:57 UTC] lsmith@php.net
actually we probably need to say that anything that goes into the global namespace needs to be prefixed by a fairly random (hopefully unique within the php community) 3-4 letter prefix or breakage is to be expected ..

see the recent issues with the File and Date objects
 [2005-11-25 13:01 UTC] lsmith@php.net
I have begun writing a guide over here:
http://oss.backendmedia.com/UserlandNamingGuide
 [2006-07-21 08:38 UTC] lsmith@php.net
OK, I think I have phpdoc karma. However I do not have a way to test changes, nor experience with phpdoc (though I am sure I will be able to figure out the xml syntax). I would however like to add the updated document. How should I best go about doing this? Where should I add the document?
 [2006-07-23 18:18 UTC] nlopess@php.net
I think a good place is the appendix. And link it from the oop5 page.
 [2006-07-23 18:21 UTC] nlopess@php.net
(sorry for double post)
about your first question, if you feel unconfortable with commiting the patch, just ask one of us in the IRC to review it or post a link here and we'll review and commit it.
 [2006-07-31 06:52 UTC] lsmith@php.net
Afaik Sean commited a fixed up XML version. Now the big question is from where this should be linked. IMHO it should be linked from the sections explaining OOP (although it also applies to PHP4 its probably sufficient to link it from the PHP5 OOP start page), exceptions, functions and constants.
 [2006-08-11 16:41 UTC] nlopess@php.net
ok, linking done.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 08:01:28 2024 UTC