php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48595 Namespace is the first statement, but error is still thrown
Submitted: 2009-06-18 13:38 UTC Modified: 2009-06-18 13:46 UTC
From: spektom at gmail dot com Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.3.0RC3 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: spektom at gmail dot com
New email:
PHP Version: OS:

 

 [2009-06-18 13:38 UTC] spektom at gmail dot com
Description:
------------
See the reproduce code... Namespace is the first statement in the PHP 
section, but the error is still thrown.

Reproduce code:
---------------
<html>
<?php
namespace ABC;

Expected result:
----------------
Work without errors.

Actual result:
--------------
Fatal error: Namespace declaration statement has to be the very first 
statement in the script in C:\Documents and 
Settings\michael\workspace\runtime-pdt\php5.3\2.php on line 3 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-18 13:42 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

No, your <html> string is the first statement. It's basically "echo '<html>';" to PHP.
 [2009-06-18 13:46 UTC] spektom at gmail dot com
I understand that intermediate non-PHP sections are implemented using 
'echo' in PHP grammar, but is this really helpful to count them as PHP 
script when we are talking about namespace scoping?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 03 14:01:30 2024 UTC