#48595 [Bgs]: Namespace is the first statement, but error is still thrown

From: Date: Thu, 18 Jun 2009 13:46:04 +0000
Subject: #48595 [Bgs]: Namespace is the first statement, but error is still thrown
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-138456@lists.php.net to get a copy of this message
ID: 48595 User updated by: spektom at gmail dot com Reported By: spektom at gmail dot com Status: Bogus Bug Type: Compile Failure Operating System: Windows PHP Version: 5.3.0RC3 New Comment: 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? Previous Comments: ------------------------------------------------------------------------ [2009-06-18 13:42:25] 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:38:17] 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48595&edit=1

« previous php.bugs (#138456) next »