PHP namespace errors

Problems with the Windows version of XAMPP, questions, comments, and anything related.

PHP namespace errors

Postby kingofwebguru » 02. March 2010 00:04

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
kingofwebguru
 
Posts: 1
Joined: 01. March 2010 23:54

Re: PHP namespace errors

Postby Altrea » 02. March 2010 08:04

Your Code works just fine on my XAMPP.

Do you save your file with Byte Order Mark?
You had to save it without BOM.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: Nobbie and 132 guests