NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Foreach Gets stuck looping through content.


Joined: 23 Sep 2015
Posts: 3
Reply with quote
Using PHped Debugger, And when stepping through,
it hits a section of code, Foreach -

This goes through a XML, and fetches the content. (Multiple XML and Multiple Nodes in XML, This the Foreach loop)

Problem i have, is XML has 10 Foreach loops, but when i step through the code, The first Data set is called.
Then the second Data set is called, When i loop through again and expect the 3rd set, I get the 2nd Set of Data again.

Regardless of how many times i loop through, Its stuck on the 2nd Data set.

Now if i put a Simple Echo - and a Unique code from the Data set, Move away from Debugger and run it as standerd, Then the code runs through fine, and i find no duplications with the Data Sets, like i was experiencing in Debugger.

So i suppose the questions are:

Anyone else had issues using a Foreach in Debugger.
Is there a limit to the Data it can store in Debugger (Is it a Miss Configuration or something)

If you would like more info, What would you like to see, Snippet of Code? Video showing it stuck on a loop?
Posting the whole code is not viable (As its closed source and Premium API bridge)
I can provide Snippets.

or if the developers of the software require further info, am happy to show a remote connection, or provide the code and steps to replicate.
View user's profileFind all posts by dave7802Send private message


Joined: 23 Sep 2015
Posts: 3
Reply with quote
After alot more testing
Its the debugger at fault, if you step through any Foreach, It appears to loose where its at, when you Step through the code.

It does not recall its previous array, So it loops through the first/second set multiple times.

If you allow the code to run to cursor and pass the for-each, it loops through each variable / data set / array correctly.

I am a paying license holder, Who can i speak to in regards to this issue, very miss leading
View user's profileFind all posts by dave7802Send private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
You might be correct that it's a bug in the debugger, but having seen a few strange issues with PHP and bearing in mind how PHP foreach loops can work a bit 'strangely' with variable references, it might not be anything to do with the debugger but more related to your accessing variables and objects during the loop.

Do you have any PhpED Watches enabled?

Are you able to share any of your code?

You can report issues at http://shop.nusphere.com/contact_us/
View user's profileFind all posts by plugnplaySend private message
Foreach Gets stuck looping through content.
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic