11

Well, I keep getting

Parse error: syntax error, unexpected T_STRING in /path/to/index.php on line 2

Googled my arse off and still nuthing, so far the index.php contains:

<?php
namespace Infire; # Line 2
...

I am using PHP 5.1

Any ideas?

2
  • 7
    is your php version >=5.3.0 ? Commented Sep 29, 2012 at 7:32
  • Check your PHP version. Only the second line and above is interesting for the error. Commented Sep 29, 2012 at 7:33

2 Answers 2

10

The PHP namespace is only supported in PHP 5.3+ version

Check this PHP 5.3.0 Release Announcement

Sign up to request clarification or add additional context in comments.

Comments

0

I've found namespaces introduced in PHP 5.3 to suffer from multiple usability problems due to performance trade-offs, limitations of PHP's parser, collisions with other PHP features and unfortunate design decisions.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.