```
//file foo.php
<?php
namespace foo;
class foo{
    function __construct(){
        echo "hello";
    }
}
?>

//file index.php
<?php
require_once("foo.php");
echo __NAMESPACE__;
?>

```

My question is, from my index.php file, is it possible to know what the namespace of foo.php is without reading the file contents and doing a regular expression on it? That just seems like a lot of overhead.

///EDIT

I'd really like to be able to dynamically add the namespace to the included file.

```
<?php
namespace dynamic;
require_once("foo.php");
echo __NAMESPACE__;
?>

```

I want to allow for third-party plugins, but php namespaces seems terrible. I don't want to have the plugin editors have to create a namespace.