note 102662 added to language.namespaces.rationale
| From: | SteveWa at osu1 dot php dot net | Date: | Sun, 27 Feb 2011 16:45:41 +0000 |
| Subject: | note 102662 added to language.namespaces.rationale | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-177378@lists.php.net to get a copy of this message | ||
Thought this might help other newbies like me...
Name collisions means:
you create a function named db_connect, and somebody elses code that you use in your file (i.e. an
include) has the same function with the same name.
To get around that problem, you rename your function SteveWa_db_connect which makes your code
longer and harder to read.
Now you can use namespaces to keep your function name separate from anyone else's function
name, and you won't have to make extra_long_named functions to get around the name collision
problem.
So a namespace is like a pointer to a file path where you can find the source of the function you
are working with
----
Server IP: 69.147.83.197
Probable Submitter: 74.67.73.165
----
Manual Page -- http://www.php.net/manual/en/language.namespaces.rationale.php
Edit -- https://master.php.net/note/edit/102662
Del: integrated -- https://master.php.net/note/delete/102662/integrated
Del: useless -- https://master.php.net/note/delete/102662/useless
Del: bad code -- https://master.php.net/note/delete/102662/bad+code
Del: spam -- https://master.php.net/note/delete/102662/spam
Del: non-english -- https://master.php.net/note/delete/102662/non-english
Del: in docs -- https://master.php.net/note/delete/102662/in+docs
Del: other reasons-- https://master.php.net/note/delete/102662
Reject -- https://master.php.net/note/reject/102662
Search -- https://master.php.net/manage/user-notes.php