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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 01:01:30 2024 UTC