#47239 [Opn->Csd]: Wrong example of using namespace keyword
| From: | danbrown@php.net | Date: | Fri, 08 May 2009 18:55:22 +0000 |
| Subject: | #47239 [Opn->Csd]: Wrong example of using namespace keyword | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-2221@lists.php.net to get a copy of this message | ||
ID: 47239
Updated by: danbrown@php.net
Reported By: kenashkov at gmail dot com
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: irrelevant
PHP Version: Irrelevant
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Previous Comments:
------------------------------------------------------------------------
[2009-01-29 15:00:04] kenashkov at gmail dot com
Description:
------------
In the manual in the section for the "namespace" keyword and
__NAMESPACE__ constant is given wrong example code.
Both calls call the same function - MyProject\blah\mine();
Tested on php 5.3-beta1
Reproduce code:
---------------
<?
namespace MyProject;
use blah\blah as mine; // see "Using namespaces: importing/aliasing"
blah\mine(); // calls function blah\blah\mine() //!wrong!
namespace\blah\mine(); // calls function MyProject\blah\mine()
?>
Expected result:
----------------
<?
namespace MyProject;
use blah\blah as mine; // see "Using namespaces: importing/aliasing"
blah\mine(); // calls function MyProject\blah\mine()
namespace\blah\mine(); // calls function MyProject\blah\mine()
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47239&edit=1