On Sat, 2010-01-30 at 13:02 +1100, clanc...@cybec.com.au wrote:
On Thu, 28 Jan 2010 10:02:56 -0500, rob...@interjinn.com (Robert Cummings)
wrote:
I don't know what you guys are doing wrong but the following should be
the correct behaviour:
?php
function get_memory( $init=false )
On Thu, 28 Jan 2010 10:02:56 -0500, rob...@interjinn.com (Robert Cummings)
wrote:
I don't know what you guys are doing wrong but the following should be
the correct behaviour:
?php
function get_memory( $init=false )
{
static $base = null;
if( $base === null || $init )
{
-Original Message-
From: Rene Veerman [mailto:rene7...@gmail.com]
Sent: 27 January 2010 22:46
And if your script needs to pass large ( 5Mb) arrays around to
functions, be sure to use passing-by-reference; failing to do so can
double your memory requirements,
possibly hitting the
Thanks for your research Mike, i'm a bit puzzled.
I have a custom random-array generator that i use to fill the
available memory to it's max, about 1.5G on a 2G system, then passing
it to a recursive json string generator.
Not passing by reference did double my memory requirements, but i've
Ford, Mike wrote:
-Original Message-
From: Rene Veerman [mailto:rene7...@gmail.com]
Sent: 27 January 2010 22:46
And if your script needs to pass large ( 5Mb) arrays around to
functions, be sure to use passing-by-reference; failing to do so can
double your memory requirements,
-Original Message-
From: Nathan Rixham [mailto:nrix...@gmail.com]
Sent: 28 January 2010 13:43
Ford, Mike wrote:
-Original Message-
From: Rene Veerman [mailto:rene7...@gmail.com]
Sent: 27 January 2010 22:46
And if your script needs to pass large ( 5Mb) arrays around
Nathan Rixham wrote:
Ford, Mike wrote:
-Original Message-
From: Rene Veerman [mailto:rene7...@gmail.com]
Sent: 27 January 2010 22:46
And if your script needs to pass large ( 5Mb) arrays around to
functions, be sure to use passing-by-reference; failing to do so can
double your memory
On Thu, Jan 28, 2010 at 11:41:43AM -, Ford, Mike wrote:
-Original Message-
From: Rene Veerman [mailto:rene7...@gmail.com]
Sent: 27 January 2010 22:46
And if your script needs to pass large ( 5Mb) arrays around to
functions, be sure to use passing-by-reference; failing to
Paul M Foster wrote:
On Thu, Jan 28, 2010 at 11:41:43AM -, Ford, Mike wrote:
-Original Message-
From: Rene Veerman [mailto:rene7...@gmail.com]
Sent: 27 January 2010 22:46
And if your script needs to pass large ( 5Mb) arrays around to
functions, be sure to use passing-by-reference;
On Wed, 2010-01-27 at 10:42 -0500, Paul M Foster wrote:
... should be obvious - but are often overlooked - points within coding
practice that can cause the programmer to develop bad habits and bad
code. - Dan Brown
Tip #1:
Don't use count() in loops unless there are very few items to
Paul M Foster wrote:
... should be obvious - but are often overlooked - points within coding
practice that can cause the programmer to develop bad habits and bad
code. - Dan Brown
Tip #1:
Don't use count() in loops unless there are very few items to count and
performance doesn't matter, or the
On Wed, 2010-01-27 at 08:01 -0800, Michael A. Peters wrote:
Paul M Foster wrote:
... should be obvious - but are often overlooked - points within coding
practice that can cause the programmer to develop bad habits and bad
code. - Dan Brown
Tip #1:
Don't use count() in loops
On Wed, Jan 27, 2010 at 11:44 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:
On Wed, 2010-01-27 at 10:42 -0500, Paul M Foster wrote:
... should be obvious - but are often overlooked - points within coding
practice that can cause the programmer to develop bad habits and bad
code. -
On Thu, 2010-01-28 at 00:08 +0800, Eric Lee wrote:
On Wed, Jan 27, 2010 at 11:44 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:
On Wed, 2010-01-27 at 10:42 -0500, Paul M Foster wrote:
... should be obvious - but are often overlooked - points within coding
practice that can
2010/1/27 Michael A. Peters mpet...@mac.com:
Paul M Foster wrote:
... should be obvious - but are often overlooked - points within coding
practice that can cause the programmer to develop bad habits and bad
code. - Dan Brown
Tip #1:
Don't use count() in loops unless there are very few
Richard Quadling wrote:
for ($i = 0, $j = count($a) ; $i $j ; ++$i) {
}
is a very common way to handle that.
Thanks!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
2010/1/27 Richard Quadling rquadl...@googlemail.com:
2010/1/27 Michael A. Peters mpet...@mac.com:
Paul M Foster wrote:
... should be obvious - but are often overlooked - points within coding
practice that can cause the programmer to develop bad habits and bad
code. - Dan Brown
Tip #1:
On Wed, Jan 27, 2010 at 16:44, Ashley Sheridan a...@ashleysheridan.co.uk
wrote:
What about using the right type of quotation marks for output:
I use double quotes() if I expect to output variables within the
string, and single quotes when it's just a simple string.
It's only a general rule
On Wed, Jan 27, 2010 at 12:08, Daniel Egeberg degeb...@php.net wrote:
There is virtually no difference nowadays. It's a long time since
anything like that has mattered.
Actually, that's not true enough to be dismissive. It depends on
several factors.
--
/Daniel P. Brown
On Wed, Jan 27, 2010 at 18:13, Daniel Brown danbr...@php.net wrote:
On Wed, Jan 27, 2010 at 12:08, Daniel Egeberg degeb...@php.net wrote:
There is virtually no difference nowadays. It's a long time since
anything like that has mattered.
Actually, that's not true enough to be dismissive.
On Wed, 2010-01-27 at 18:26 +0100, Daniel Egeberg wrote:
On Wed, Jan 27, 2010 at 18:13, Daniel Brown danbr...@php.net wrote:
On Wed, Jan 27, 2010 at 12:08, Daniel Egeberg degeb...@php.net wrote:
There is virtually no difference nowadays. It's a long time since
anything like that has
On Wed, Jan 27, 2010 at 12:26, Daniel Egeberg degeb...@php.net wrote:
Well, I would still say it's far too insignificant to bother with.
And for the most part, you'd be right but it still isn't good
practice to *not* teach something strictly because it's not entirely
significant.
Ashley Sheridan wrote:
On Wed, 2010-01-27 at 18:26 +0100, Daniel Egeberg wrote:
On Wed, Jan 27, 2010 at 18:13, Daniel Brown danbr...@php.net wrote:
On Wed, Jan 27, 2010 at 12:08, Daniel Egeberg degeb...@php.net wrote:
There is virtually no difference nowadays. It's a long time since
anything
On Wed, Jan 27, 2010 at 12:27, Ashley Sheridan a...@ashleysheridan.co.uk
wrote:
Depends I guess on how far you need to optimise the code. I'd imagine that to
something like Facebook, every split-second of optimisation is worth it, as
even a 100th of a second becomes minutes of wasted time
Daniel Brown wrote:
On Wed, Jan 27, 2010 at 12:27, Ashley Sheridan a...@ashleysheridan.co.uk
wrote:
Depends I guess on how far you need to optimise the code. I'd imagine that to
something like Facebook, every split-second of optimisation is worth it, as
even a 100th of a second becomes
I'd like to add that when dealing with large memory structures,
usually arrays, combining them is fastest when done like this:
$array1 += $array2;
This will not always produce correct results when dealing with arrays
that contain identical keys, but for non-overlapping arrays it is far
faster
Daniel Egeberg wrote:
On Wed, Jan 27, 2010 at 18:13, Daniel Brown danbr...@php.net wrote:
On Wed, Jan 27, 2010 at 12:08, Daniel Egeberg degeb...@php.net wrote:
There is virtually no difference nowadays. It's a long time since
anything like that has mattered.
Actually, that's not true
27 matches
Mail list logo