Hi,

I've a few questions about the namespace patch:

1) Why is "import Foo" a no-op?
Shouldn't it import everything define inside Foo?

2) How can I import all classes from a namespace at once?
Like question 1) actually. "import Foo::*" doesn't work.

3) Shouldn't there be an error when importing a class which already
existing in the current scope? Example

---------------8<--------------------
ns2.php:
<?php
        namespace Foo;
        class Bar {
                public function __construct() {
                        echo "Namespace class\n";
                }
        }

ns1.php:
<?php
        require_once 'ns2.php';
        class Bar {
                public function __construct() {
                        echo "No namespace class\n";
                }
        }
        import Foo::Bar;
        new Bar;


C:\...\Desktop\php6>php ns1.php
Namespace class
---------------8<--------------------

I read the thread an I know that I can still call access the global
class with ::Bar ... but is this a intuitive behaviour?

thanks,
- Markus

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to