Re: my last attempt at sanity with namespaces

From: Date: Thu, 16 Oct 2008 12:55:14 +0000
Subject: Re: my last attempt at sanity with namespaces
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-41120@lists.php.net to get a copy of this message
2008/10/15 Greg Beaver <greg@chiaraquartet.net>: > Hi, > > http://wiki.php.net/rfc/namespaceissues > > Read it and discuss. Let's be clear people: the technical problems in > namespaces are limited and solvable. The problems in the political > environment surrounding them may not be. Wouldn't politics be a > stupid-ass reason to remove namespaces? > > Greg With regard to accessing internal classes within a namespace, would using the namespace separator be enough? namespace blah; function __autoload($class) { include $class . '.php'; } $a = new Exception('hi'); // Internal $b = new :::Execption('lo'); // Namespaced It seems that it is up to me as the userland develop to explicitly identify namespaces vs classes (I like :::), so I would have though I'd need to deal with this when I want to call my namespaced class vs a built in class. Autoload would only get called if the correctly identified namespaced class wasn't already present. If I said use the built in class, then so be it. OOI, would __autoload get "blah:::Exception" or just "Exception" ? If the latter, how would I differentiate? -- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!"

« previous php.internals (#41120) next »