Would this not do the same thing and perhaps be easier to implement:

namespace Foo;
protected $var;

class Bar {

}

thus allowing use of private public protected before variables, and hell why not classes aswell.

private = only methods, code, classes in namespace Foo have access
protected = only methods, code, classes in namespace Foo or children Foo::Too have access
public = everybody

the same inheritance rules etc as classes.. makes sence :) and great idea!

got my vote, especially with the braces in namespaces!

namespace Foo; {
  protected $var;

  public class Extender {

     public function __construct() {
         ......
     }
  }
}

Nathan

Ralph Schindler wrote:
Since everyone is in the "namespace" frame of mind, is there a possibility of a "namespace" access modifier?

The way I envision this working is that if for example:

namespace Foo;

class Bar {
  nsprotected $_someProperty = null;
}

(or some other equivalent grammer)

Would allow the property Foo::Bar::$_someProperty to be accessed from any class that has implemented a class from the Foo namespace.

Reaching for straws or is this a possibility?

-ralph

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

Reply via email to