phpgroupware-developers
[Top][All Lists]
Advanced

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

Re: [Phpgroupware-developers] Calendar planer problem (0.9.14)


From: Scott Courtney
Subject: Re: [Phpgroupware-developers] Calendar planer problem (0.9.14)
Date: Tue, 16 Jul 2002 09:48:11 -0400

On Monday 15 July 2002 07:32 pm, Sam Przyswa wrote:
> >       while (list($nul,$event) = @each($daily))

As a general rule, wouldn't it be wise to put a reset($daily) line ahead of
this while() loop, just in case the array pointer happens to be not at the
start of the array when arriving at this code section? I generally do this
even if I "think" it will always be at the start of the array -- just to be
on the safe side. This has bitten me once or twice in the past. :-)

Alternative code:

     foreach ($daily as $event) {

The foreach() loop performs an implicit reset(), according to the online PHP
documentation.

Scott

-- 
-----------------------+------------------------------------------------------
Scott Courtney         | "I don't mind Microsoft making money. I mind them
address@hidden       | having a bad operating system."    -- Linus Torvalds
http://4th.com/        | ("The Rebel Code," NY Times, 21 February 1999)
                       | PGP Public Key at http://4th.com/keys/courtney.pubkey




reply via email to

[Prev in Thread] Current Thread [Next in Thread]