This is not possible in PHP.
All you can do is:
namespace Foo;
use Bar;
$obj = new Bar\SomeClassFromBar();
More Related Contents:
- What does a \ (backslash) do in PHP (5.3+)?
- Parse XML with Namespace using SimpleXML [duplicate]
- Loading .sql files from within PHP
- Importing CSV data using PHP/MySQL
- How does the keyword “use” work in PHP and can I import classes with it?
- parse an XML with SimpleXML which has multiple namespaces [duplicate]
- PHP namespace simplexml problems
- Copy Image from Remote Server Over HTTP
- Import CSV file directly into MySQL
- How to import/include a CSS file using PHP code and not HTML code?
- Can PHP namespaces contain variables?
- Remove BOM () from imported .csv file
- How to use objects from other namespaces and how to import namespaces in PHP
- Unexpected character in input: ‘\’ (ASCII=92) state=1
- Autoloading classes in PHPUnit using Composer and autoload.php
- Namespace in PHP CodeIgniter Framework
- How to get all class names inside a particular namespace?
- PHP namespace with Dynamic class name
- How to use “root” namespace of php?
- SimpleXML: Working with XML containing namespaces
- PHP namespaces and “use”
- PHP adding custom namespace using autoloader from composer
- How to get attribute of node with namespace using SimpleXML? [closed]
- Troubleshooting “The use statement with non-compound name … has no effect”
- Class ‘App\Http\Controllers\DB’ not found and I also cannot use a new Model
- Using namespaces in Laravel 4
- Process very big csv file without timeout and memory error
- PHP namespace PDO not found
- Facebook SDK v4 for PHP Minimal Example
- unexpected ‘use’ (T_USE) when trying to use composer