PHP 4.0 Bug #7115: Global is way slower then $GLOBALS
| From: | wico at cnh dot nl | Date: | Tue, 10 Oct 2000 09:05:39 +0000 |
| Subject: | PHP 4.0 Bug #7115: Global is way slower then $GLOBALS | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-34556@lists.php.net to get a copy of this message | ||
From: wico@cnh.nl
Operating system: linux
PHP version: 4.0 Latest CVS (10/10/2000)
PHP Bug Type: Performance problem
Bug description: Global is way slower then $GLOBALS
hiya
$ADLIB_DATA is a ARRAY of a file of 8 meg count($ADLIB_DATA) = 369459
ofcourse this all is in a function (file_init and getting the data is outside the function)
for ($x = 0; $x < 33; $x++) {
$data .= $GLOBALS[ADLIB_DATA][$x];
}
echo time() - $test . " seconden<BR>\n\n";
this takes 1 sec
GLOBAL $ADLIB_DATA;
for ($x = 0; $x < 33; $x++) {
$data .= ADLIB_DATA[$x];
}
echo time() - $test . " seconden<BR>\n\n";
this takes 20 sec!!!
Something weird?
Greetz,
Wico
--
Edit Bug report at: http://bugs.php.net/?id=7115&edit=1