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
 [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: Fri Apr 19 11:01:28 2024 UTC