php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #66004 Parse error in an example of the namespace section
Submitted: 2013-10-30 18:31 UTC Modified: 2014-05-24 01:50 UTC
From: admin at rafaelbarros dot eti dot br Assigned: bjori (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2013-10-30 18:31 UTC] admin at rafaelbarros dot eti dot br
Description:
------------
Page: http://www.php.net/manual/en/language.namespaces.faq.php#language.namespaces.faq.quote

Example: "Example #9 Dangers of using namespaced names inside a double-quoted string"

There's a "Parse error": it shouldn't have a "new" clause before the strings.

Test script:
---------------
$a = new "dangerous\name";
$obj = new $a;

$a = new 'not\at\all\dangerous';
$obj = new $a;

Actual result:
--------------
Parse error: syntax error, unexpected '"dangerous\name"' (T_CONSTANT_ENCAPSED_STRING) in C:\xampp\htdocs\test\index.php on line 2

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-31 01:36 UTC] bjori@php.net
Automatic comment from SVN on behalf of bjori
Revision: http://svn.php.net/viewvc/?view=revision&revision=332025
Log: Fixed bug#66004 (Parse error in an example of the namespace section)
 [2013-10-31 01:36 UTC] bjori@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: bjori
 [2013-10-31 01:36 UTC] bjori@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.

Nice catch!
 [2014-05-24 01:50 UTC] admin at rafaelbarros dot eti dot br
-: admin at wmfoi dot com dot br +: admin at rafaelbarros dot eti dot br
 [2014-05-24 01:50 UTC] admin at rafaelbarros dot eti dot br
E-mail changed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 00:01:30 2024 UTC