Assignment (Was Re: [PHP] More microptimisation (Was Re: [PHP] Variable as an index)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 9:10 AM +1100 12/23/08, Clancy wrote:
Schlossnagle (in "Advanced PHP Programming") advises:

$i = 0; while ($i < $j)
	{
	........
	++$i;
	}

rather than:

$i = 0; while ($i < $j)
	{
	.......
	$i++;
	}

as the former apparently uses less memory references. However I find it very hard to

Two things:

1. One statement, one line.
2. The code between the two examples is different; produces different results; and thus is rather pointless in making a definitive comparison.

Assignment, demonstrate a correct way to test ++i vs i++.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux