Re[2]: [PHP] nested, referenced foreach & implicit current array pointer issues
- From: speedy.spam@xxxxxxxxx (speedy)
- Date: Wed, 31 Jan 2007 20:57:28 +0100
Hello Jochem,
Wednesday, January 31, 2007, 7:41:42 PM, you wrote:
use of 'global' is bad practice in anything that resembles a complex/real
application. your function has no control over the what $arr is and any piece of
code code change $arr into *anything* at any time.
instead I would suggest that your better off doing one of 2 things:
bad advice? I'm open to being corrected :-)
I wondered privately if anyone would give that very useful advice. O:)
It is similar to what I told a colleague who wrote the code which
triggered the bug. :) (side-note: I was kinda sympathetic to what he did - he
was cutting corners in a relatively small, stand-alone project :p)
Be what may be, the hard-to-debug side-effect stands as weak point
of PHP design no less.
--
Best regards,
speedy mailto:speedy.spam@xxxxxxxxx
.
- References:
- nested, referenced foreach & implicit current array pointer issues
- From: speedy
- Re: [PHP] nested, referenced foreach & implicit current array pointer issues
- From: "Martin Alterisio"
- Re[2]: [PHP] nested, referenced foreach & implicit current array pointer issues
- From: speedy
- Re: Re[2]: [PHP] nested, referenced foreach & implicit current array pointer issues
- From: "Martin Alterisio"
- Re[4]: [PHP] nested, referenced foreach & implicit current array pointer issues
- From: speedy
- Re: [PHP] nested, referenced foreach & implicit current array pointer issues
- From: Jochem Maas
- nested, referenced foreach & implicit current array pointer issues
- Prev by Date: Re: [PHP] nested, referenced foreach & implicit current array pointer issues
- Next by Date: RE: [PHP] Need desperate help with query
- Previous by thread: Re: [PHP] nested, referenced foreach & implicit current array pointer issues
- Next by thread: Manipulating "categories" in a mysql database
- Index(es):