note 80035 deleted from language.namespaces by philip
| From: | philip@php.net | Date: | Fri, 28 Nov 2008 18:50:42 +0000 |
| Subject: | note 80035 deleted from language.namespaces by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-147102@lists.php.net to get a copy of this message | ||
Note Submitter: Amir Abiri
----
So, if I understand correctly there is a possible ambiguity that can cause a function or method to
become "masked".
If I have:
global.php:
<?php
class A
{
static public function foo()
{
}
}
A::foo(); // Will statically call method foo() of class ::A.
?>
If I now added the following to my project:
A.php:
<?php
namespace A;
function foo()
{
}
?>
The function call above would instead call this new function.
It shouldn't be a problem most of the time and specially if certain basic practices are
followed (For example, don't name classes and namespaces the same name, and always keep
different packages in their own separate namespaces), but it's something to keep in mind.