RE: [PHP-DEV] Simple Namespace Proposal

From: Date: Wed, 04 Jul 2007 15:15:51 +0000
Subject: RE: [PHP-DEV] Simple Namespace Proposal
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-30447@lists.php.net to get a copy of this message
> > It is possible to use the same namespace in several PHP files. > > Does this mean that a project like Phorum could declare the same > namespace at the top of all of our files and all the code in > those files > would exist in the same namespace? Exactly. > common.php: > <?php > namespace Phorum; > > $PHORUM = get_settings(); > > function phorum_build_url(){ > return $url; > } > ?> > > list.php: > <?php > namespace Phorum; > > $url - phorum_build_url(); > > ?> > > > Or, would list.php have to import the Phorum namespace? > > Also, I don't see any mention of variables in namespaces. > Will there be > no effect on variables? Nor variables naither constants. They are defined in run-time. Dmitry. > > -- > > Brian Moon > Senior Developer > ------------------------------ > http://dealnews.com/ > It's good to be cheap =) >

« previous php.internals (#30447) next »