php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70610 Misleading example of "illegal" importing rule
Submitted: 2015-09-30 17:22 UTC Modified: 2016-06-14 17:03 UTC
From: krewecherl at gmail dot net Assigned: cmb (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2015-09-30 17:22 UTC] krewecherl at gmail dot net
Description:
------------
Referring to the English manual page about "Using namespaces:
Aliasing/Importing"
http://php.net/manual/en/language.namespaces.importing.php

Example #5 is supposed to show an illegal importing rule. What it
actually shows is something different: the insertion of a Trait.
This is (now) perfectly valid PHP, it just does something different
from what the page is describing.

I assume the example was added before we had traits; it should be
updated to avoid confusion. Since the preceding paragraph is
referring to scope, perhaps the class should be replaced by a
function.

Test script:
---------------
<?php
// not a test script, this is example #5 from the manual page

namespace Languages;

class Greenlandic
{
    use Languages\Danish;

    ...
}
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-06-14 17:01 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=339351
Log: Fix #70610: Misleading example of &quot;illegal&quot; importing rule
 [2016-06-14 17:03 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2016-06-14 17:03 UTC] cmb@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, Stefan, and for helping us make our
documentation better.
 [2020-02-07 06:07 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=e52f86cf48f181cefa150a4d89c90a8a8a5c6bad
Log: Fix #70610: Misleading example of &quot;illegal&quot; importing rule
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 06:01:30 2024 UTC