Re: Tie'ing variables

From: Date: Sat, 01 Mar 2003 17:11:05 +0000
Subject: Re: Tie'ing variables
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-94704@lists.php.net to get a copy of this message
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... Derick -- Stop mad cowboy disease! ------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ -------------------------------------------------------------------------

« previous php.dev (#94704) next »