Thanks for the second explanation.
If I hadn't wasted so much of your time, I would say this whole example is hilarious :)
I managed to construct the exact set of circumstances to ensure that the "for" and "foreach" loop gave identical answers:
a) I chose five variables for @stack
b) I...
I need to be able to maintain a stack which varies in length according to circumstances. I want to use shift() and unshift() at the left, and push() and pop() at the right.
I have noticed strange behaviour when using shift(). My simple example below shows the problem.
In this example, when I...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.