in reply to 'my' and 'state' declaration inside a loop

In any case I would not choose one vs. the other on the notion that it is "more" or "less" "efficient." Use the cleanest construct that makes the most sense to you to get the job done, and be done with it. It's truly an extraordinary edge-case when a profiler demonstrates a difference in such things that actually makes a difference.
  • Comment on Re: 'my' and 'state' declaration inside a loop

Replies are listed 'Best First'.
Re^2: 'my' and 'state' declaration inside a loop
by nemesisgus (Acolyte) on Aug 05, 2012 at 16:31 UTC
    Thanks for your comment, I agree. Clarity is preferred over a slight gain in performance if the same task can be achieved in different ways.