php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63372 Namespace Declaration Missing Parse Error
Submitted: 2012-10-26 19:15 UTC Modified: 2012-10-26 20:51 UTC
From: hanskrentel at yahoo dot de Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.4.8 OS:
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: hanskrentel at yahoo dot de
New email:
PHP Version: OS:

 

 [2012-10-26 19:15 UTC] hanskrentel at yahoo dot de
Description:
------------
The following file namespace declaration:

namespace \Name;

Does not give a Parse Error. It's sister declaration:

namespace \Name {}

does.


Test script:
---------------
<?php
namespace \Name;


Expected result:
----------------
Parse Error in Line 2 about an unexpected ; or T_NAMESPACE_SEPARATOR

Actual result:
--------------
Parser has no problem with the file at all.

Problems become only noticeable at runtime then.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-10-26 20:51 UTC] hanskrentel at yahoo dot de
-Status: Open +Status: Closed -Package: Class/Object related +Package: Scripting Engine problem
 [2012-10-26 20:51 UTC] hanskrentel at yahoo dot de
Solved. Thanks NikiC http://stackoverflow.com/a/13094151/367456
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 11:01:29 2024 UTC