php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #66047 Traits are also affected by Namespaces
Submitted: 2013-11-07 15:48 UTC Modified: 2013-11-08 07:42 UTC
From: bug dot php dot net at e-z dot name Assigned: krakjoe (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2013-11-07 15:48 UTC] bug dot php dot net at e-z dot name
Description:
------------
in:
http://www.php.net/manual/en/language.namespaces.definition.php

It says: only four types of code are affected by namespaces: classes, interfaces, functions and constants.


It needs to be updated because TRAITS are also affected by NAMESPACES.


Test script:
---------------
namespace FOO;

trait fooFoo {}

namespace BAR;

class baz
{
    use fooFoo; // Fatal error: Trait 'BAR\fooFoo' not found in
}

Expected result:
----------------
only FIVE types of code are affected by namespaces: classes, interfaces, TRAITS functions and constants.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-11-08 07:42 UTC] krakjoe@php.net
Automatic comment from SVN on behalf of krakjoe
Revision: http://svn.php.net/viewvc/?view=revision&revision=332082
Log: #66047 update namespaces.definition for traits and clarity
 [2013-11-08 07:42 UTC] krakjoe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: krakjoe
 [2013-11-08 07:42 UTC] krakjoe@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: Sun Oct 11 23:00:01 2026 UTC