php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #47239 Wrong example of using namespace keyword
Submitted: 2009-01-29 15:00 UTC Modified: 2009-05-08 18:55 UTC
From: kenashkov at gmail dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kenashkov at gmail dot com
New email:
PHP Version: OS:

 

 [2009-01-29 15:00 UTC] 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()
?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-08 18:55 UTC] danbrown@php.net
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.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 05:00:01 2026 UTC