Page 1 of 1

PHP namespace errors

PostPosted: 02. March 2010 00:04
by kingofwebguru
Hi everyone,

Could anyone please tell me how to solve this problem?

When I run this PHP script below.
----------------------------
<?php //line 1
namespace namespacename; //line 2
?>
----------------------------

I received:
---------------------
Fatal error: Namespace declaration statement has to be the very first statement in the script.

--------------------

My settings:
XAMPP Windows 1.7.3, XP Pro sp3, the other PHP installation (ver 5.3.1) installed, iis stopped.

Thank you for your help and time.

Steve

Re: PHP namespace errors

PostPosted: 02. March 2010 08:04
by Altrea
Your Code works just fine on my XAMPP.

Do you save your file with Byte Order Mark?
You had to save it without BOM.