This is probably due to your interpreter settings in Eclipse.
Go to the Project menu and select Properties . When the Properties screen appears, you can go to PHP Interpreter and configure the PHP version at the project level or workspace level.
Set PHP version 5.3 or higher for proper highlighting.
If your project is in PHP 5.2, you will not be able to use namespaces. See Here: Namespaces in php 5.2
source share