Date: 09/15/01
- Next message: ncroiset <email protected>: "[PHP-DEV] Bug #13318: check compiler failure"
- Previous message: phanto <email protected>: "[PHP-DEV] Bug #12471 Updated: DCOM don't running"
- Next in thread: joey <email protected>: "[PHP-DEV] Bug #13317 Updated: Optimizing Bug for 'sizeof' function"
- Reply: joey <email protected>: "[PHP-DEV] Bug #13317 Updated: Optimizing Bug for 'sizeof' function"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: mladdens <email protected>
Operating system: Unix/Linux
PHP version: 4.0.6
PHP Bug Type: Performance problem
Bug description: Optimizing Bug for 'sizeof' function
There is a huge diference in speed with these two approaches:
$file=file("file.txt");
1.
for($i=0;$i<sizeof($file);$i++)
...
2.
$file_size=sizeof($file);
for($i=0;$i<$file_size;$i++)
...
The second approach is much more faster, because the first seems to
calculate the 'sizeof' in every iteration.
-- Edit bug report at: http://bugs.php.net/?id=13317&edit=1-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: ncroiset <email protected>: "[PHP-DEV] Bug #13318: check compiler failure"
- Previous message: phanto <email protected>: "[PHP-DEV] Bug #12471 Updated: DCOM don't running"
- Next in thread: joey <email protected>: "[PHP-DEV] Bug #13317 Updated: Optimizing Bug for 'sizeof' function"
- Reply: joey <email protected>: "[PHP-DEV] Bug #13317 Updated: Optimizing Bug for 'sizeof' function"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

