PHP 4.0 Bug #7115 Updated: Global is way slower then $GLOBALS

From: Date: Sat, 16 Dec 2000 19:28:12 +0000
Subject: PHP 4.0 Bug #7115 Updated: Global is way slower then $GLOBALS
Groups: php.dev 
Request: Send a blank email to php-dev+get-41608@lists.php.net to get a copy of this message
ID: 7115 Updated by: waldschrott Reported By: wico@cnh.nl Old-Status: Open Status: Bogus Bug Type: Performance problem Assigned To: Comments: bogus my test setup (slightly modified, basically using $data2 the second time) shows that the GLOBAL method is faster (expected), using your method appending all to $data the GLOBAL way took twice as long (tendency raising) your test script has several lacks a) parse error (forget $ in 2nd ADLIB_DATA) b) no starting time gotten and now the MAJOR one c) everything is appended to $data so, what do you expect? Previous Comments: --------------------------------------------------------------------------- [2000-10-10 05:05:38] wico@cnh.nl 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>nn"; this takes 1 sec GLOBAL $ADLIB_DATA; for ($x = 0; $x < 33; $x++) { $data .= ADLIB_DATA[$x]; } echo time() - $test . " seconden<BR>nn"; this takes 20 sec!!! Something weird? Greetz, Wico --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=7115

« previous php.dev (#41608) next »