php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7113 count and pointers
Submitted: 2000-10-10 04:45 UTC Modified: 2001-01-22 19:28 UTC
From: wico at cnh dot nl Assigned:
Status: Closed Package: Performance problem
PHP Version: 4.0 Latest CVS (10/10/2000) OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: wico at cnh dot nl
New email:
PHP Version: OS:

 

 [2000-10-10 04:45 UTC] wico at cnh dot nl
Hiya

$ADLIB_FILE is a file, size = 9mb

	$ADLIB_DATA = file($ADLIB_FILE);
	$ADLIB_COUNT = count($ADLIB_DATA);
	echo time() - $test . " seconden<BR>\n\n";
	die();

takes 17 secs

	$ADLIB_DATA = file($ADLIB_FILE);
	$ADLIB_COUNT = count(&$ADLIB_DATA);
	echo time() - $test . " seconden<BR>\n\n";
	die();
this takes 27 secs?

shouldn't this be faster the the first one?

Greetz,

Wico


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-22 19:28 UTC] sterling@php.net
no, it shouldn't--in php yes it should, php4 is pretty smart about this though.  Objects are the only thing where speed increases by pass-by-reference.  otherwise its slower.  But you shouldn't be using references as an optimization anyway...
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 08:01:30 2025 UTC