Re: [PHP-DEV] Tie'ing variables

[email protected] (Sterling Hughes)
Newsgroups php.dev
Message-ID <1046541514.21518.1425.camel@hasele>
On Sat, 2003-03-01 at 13:09, Faisal Nasim wrote:
> At 10:26 PM 3/1/2003, Marcus Börger wrote:
> > At 18:11 01.03.2003, Derick Rethans wrote:
> > > On Sat, 1 Mar 2003, Sterling Hughes wrote:
> > > 
> > > > Analyzing PHP's routines a bit, it seems that the slowest part
> > > of a
> > > > "generic" request is populating the special arrays, $_ENV,
> > > $_GET, etc.
> > > >
> > > > I was wondering if it might be possible to "tie" these arrays to
> > > a
> > > > function (if you don't understand that, look at Perl for a
> > > definition).
> > > > One could populate them as an overloaded object, and then array
> > > accesses
> > > > would work - I guess.  But I would prefer a cleaner mechanism.
> > > 
> > > Why not just populate them when you need them? IE, if you access
> > > $_GET['foo'] it processes the GET data until it has processed upto
> > > foo
> > > in the data itself(and of course it adds the other ones that are
> > > before 'foo' in the GET data to the array too). With this you
> > > never
> > > process more data then you really need...
> > 
> > And for a quick start it would be enogh to simply initialize these
> > vars upon
> > first access. If we can do this the rest might be easy -> "devide
> > and conquer"!
> 
> Just had a thought. Wouldn't it be possible for some intermediate
> included script to change the data which is parsed and stored into
> $_GET (and family) upon first request?
> 

err, it already is possible for an included scripting to change the
value of $_GET variables.  I don't see what request order matters,
variables are parsed per-request.

-Sterling


> Faisal
-- 
"Science is like sex: sometimes something useful comes out, 
but that is not the reason we are doing it." 
    - Richard Feynman
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.