Re: Simple Namespace Proposal

From: Date: Mon, 16 Jul 2007 01:59:07 +0000
Subject: Re: Simple Namespace Proposal
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-30952@lists.php.net to get a copy of this message
I've attached some phpt files to test this, but here's a simple illustration: foo.php: <?php namespace foo; function foobar() { } class Foobaz { } ?> bar.php: <?php import foo; foobar(); // error new Foobaz; // error foo::foobar(); // ok new foo::Foobaz; // ok
That's how it's supposed to work. Import foo is a no-op.
import foo::foobar; import foo::Foobaz; foobar(); // error new Foobaz; // ok
Well, this one might be an error - I think direct import of functions might be OK. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#30952) next »